Examples of toGregorianCalendar()


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

        }
    }
   
    private void assertJavaxAndFTLXSDateTimesSame(String s) throws DateParseException {
        XMLGregorianCalendar xgc = datetypeFactory.newXMLGregorianCalendar(s);
        Date javaxDate = xgc.toGregorianCalendar().getTime();
        Date ftlDate = DateUtil.parseXSDateTime(s, TimeZone.getDefault(), cf2dc);
        assertEquals(javaxDate, ftlDate);
    }

    private void assertDateParsing(String expected, String parsed, TimeZone tz) throws DateParseException {
View Full Code Here

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

  return o;
    }

    public String formatObject(Object object) {
  XMLGregorianCalendar calendar = (XMLGregorianCalendar) object;
  return dateFormatter.format(calendar.toGregorianCalendar().getTime());
    }

    /**
     * @param dateFormatter
     *            the dateFormatter to set
View Full Code Here

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

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

        GregorianCalendar cal = xmlGregorianCalender.toGregorianCalendar();
        cal.setTimeZone(getTimeZone());

        QName  calendarQName = xmlGregorianCalender.getXMLSchemaType();
        if(!calendarQName.equals(schemaType)){
            if (XMLConstants.DATE_QNAME.equals(schemaType)){
View Full Code Here

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

        }
        // An XMLGregorianCalendar will be used to parse the date string
        XMLGregorianCalendar xgc = getXMLConversionManager().convertStringToXMLGregorianCalendar(dateString);
        Calendar cal;
        if (xgc.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
            cal = xgc.toGregorianCalendar(getXMLConversionManager().getTimeZone(), locale, null);
            cal.clear(Calendar.ZONE_OFFSET);
        } else {
            cal = xgc.toGregorianCalendar(xgc.getTimeZone(xgc.getTimezone()), locale, null);
        }
        return cal;
View Full Code Here

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

        Calendar cal;
        if (xgc.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
            cal = xgc.toGregorianCalendar(getXMLConversionManager().getTimeZone(), locale, null);
            cal.clear(Calendar.ZONE_OFFSET);
        } else {
            cal = xgc.toGregorianCalendar(xgc.getTimeZone(xgc.getTimezone()), locale, null);
        }
        return cal;
    }

    /**
 
View Full Code Here

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

             }
        }
        if(xmlGregorianCalender == null) {
            return null;
        }
        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()

        }
        // An XMLGregorianCalendar will be used to parse the date string
        XMLGregorianCalendar xgc = getXMLConversionManager().convertStringToXMLGregorianCalendar(dateString);
        Calendar cal;
        if (xgc.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
            cal = xgc.toGregorianCalendar(getXMLConversionManager().getTimeZone(), locale, null);
            cal.clear(Calendar.ZONE_OFFSET);
        } else {
            cal = xgc.toGregorianCalendar(xgc.getTimeZone(xgc.getTimezone()), locale, null);
        }
        return cal;
View Full Code Here

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

        Calendar cal;
        if (xgc.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
            cal = xgc.toGregorianCalendar(getXMLConversionManager().getTimeZone(), locale, null);
            cal.clear(Calendar.ZONE_OFFSET);
        } else {
            cal = xgc.toGregorianCalendar(xgc.getTimeZone(xgc.getTimezone()), locale, null);
        }
        return cal;
    }

    /**
 
View Full Code Here

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

    {
        try
        {
            DatatypeFactory f = DatatypeFactory.newInstance() ;
            XMLGregorianCalendar cal = f.newXMLGregorianCalendar(lex) ;
            long millis = cal.toGregorianCalendar().getTimeInMillis() ;
            Timestamp timestamp = new Timestamp(millis) ;
            return timestamp.toString() ;
        } catch (DatatypeConfigurationException e)
        {
            LoggerFactory.getLogger(SQLUtils.class).warn("Failed to convert "+lex, e) ;
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
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.