Examples of toGregorianCalendar()


Examples of javax.xml.datatype.XMLGregorianCalendar.toGregorianCalendar()

    }
    CloudStoreObjectMetadata meta = new CloudStoreObjectMetadata( );
    meta.setContentLengthInBytes( entry.getSize( ) );
    meta.setETag( entry.getETag( ) );
    XMLGregorianCalendar xmlLastMod = entry.getLastModified( );
    meta.setLastModifiedDate( xmlLastMod.toGregorianCalendar( )
      .getTime( ) );
    obj.setMetadata( meta );
    output.add( obj );
      }
     
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toGregorianCalendar()

      if (ClassUtils.isAssignable(type, java.util.Date.class)) {
          returnValue = this.transformCalendarToDate((Calendar) returnValue);
      }
    } else if (String.class.equals(type) && (value instanceof XMLGregorianCalendar)) {
            XMLGregorianCalendar xmlCalendar = (XMLGregorianCalendar) value;
            returnValue = this.transformDateToString(xmlCalendar.toGregorianCalendar().getTime());
           
    } else {
      throw new IllegalArgumentException("Incorrect type for transformer class");
    }
   
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toGregorianCalendar()

             }else{
                 throw XMLConversionException.incorrectTimestampDateTimeFormat(sourceString);
             }
        }

        GregorianCalendar cal = xmlGregorianCalender.toGregorianCalendar();
        if(xmlGregorianCalender.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
            cal.setTimeZone(getTimeZone());
        }
        QName  calendarQName = xmlGregorianCalender.getXMLSchemaType();
        if(!calendarQName.equals(schemaType)){
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toGregorianCalendar()

  @Override
  public Date dateTimeValue(Value node) {
      try {
          XMLGregorianCalendar cal = ((Literal)node).calendarValue();
          //TODO: check if we need to deal with timezone and Local here
          return cal.toGregorianCalendar().getTime();
      } catch (ClassCastException e) {
          throw new IllegalArgumentException("Value "+node.stringValue()+" is not a literal" +
                  "but of type "+debugType(node));
      }
  }
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toGregorianCalendar()

    @Override
    public Date dateTimeValue(Value node) {
        try {
            XMLGregorianCalendar cal = ((Literal)node).calendarValue();
            //TODO: check if we need to deal with timezone and Local here
            return cal.toGregorianCalendar().getTime();
        } catch (ClassCastException e) {
            throw new IllegalArgumentException("Value "+node.stringValue()+" is not a literal" +
                    "but of type "+debugType(node));
        }
    }
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toGregorianCalendar()

    @Override
    public Date dateTimeValue(Value node) {
        try {
            XMLGregorianCalendar cal = ((Literal)node).calendarValue();
            //TODO: check if we need to deal with timezone and Local here
            return cal.toGregorianCalendar().getTime();
        } catch (ClassCastException e) {
            throw new IllegalArgumentException("Value "+node.stringValue()+" is not a literal" +
                    "but of type "+debugType(node));
        }
    }
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toGregorianCalendar()

        try {
            factory = DatatypeFactory.newInstance();
            XMLGregorianCalendar cal = factory.newXMLGregorianCalendar(newVal);

            pParsePosition.setIndex(idxSpc);
            return cal.toGregorianCalendar();
        } catch (DatatypeConfigurationException e) {
            pParsePosition.setErrorIndex(offset);
        }
        return null;
    }
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toGregorianCalendar()

            throw new InvalidIdException(wsId);
        }
        List<String> authors =
                (wsAuthors == null ? new ArrayList<String>() : wsAuthors);
        Date publicationDate = (wsPublicationDate != null ?
                wsPublicationDate.toGregorianCalendar().getTime() : null);

        return new KAMStoreDaoImpl.Citation(
                wsName, id.toString(), wsComment, publicationDate, authors,
                convert(wsCitationType));
    }
View Full Code Here

Examples of org.joda.time.DateTime.toGregorianCalendar()

    @Override
    public Object fromString(final String str) {
        for (final DateTimeFormatter formatter : formattersUTC) {
            try {
                final DateTime dt = formatter.parseDateTime(str);
                final Calendar calendar = dt.toGregorianCalendar();
                calendar.setTimeZone(TimeZone.getDefault());
                return calendar;
            } catch (final IllegalArgumentException e) {
                // try with next formatter
            }
View Full Code Here

Examples of org.joda.time.DateTime.toGregorianCalendar()

        final String timeZoneID = TimeZone.getDefault().getID();
        for (final DateTimeFormatter element : formattersNoUTC) {
            try {
                final DateTimeFormatter formatter = element.withZone(DateTimeZone.forID(timeZoneID));
                final DateTime dt = formatter.parseDateTime(str);
                final Calendar calendar = dt.toGregorianCalendar();
                calendar.setTimeZone(TimeZone.getDefault());
                return calendar;
            } catch (final IllegalArgumentException e) {
                // try with next formatter
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.