Examples of toXMLFormat()


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

            cal.setTime(sourceTime);

            xgc.setMonth(cal.get(Calendar.MONTH)+1);


            String xmlFormat = xgc.toXMLFormat();
            // GMonths have different representations depending on JDK version:
            // JDK 1.5: "--MM--"   JDK 1.6: "--MM"
            // Default support is for 1.6, so if string length == 6, chop off the last two characters
            if (xmlFormat.length() == 6) {
                xmlFormat = xmlFormat.substring(0, 4);
View Full Code Here

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

            cal.setTime(sourceTime);

            xgc.setMonth(cal.get(Calendar.MONTH)+1);
            xgc.setDay(cal.get(Calendar.DAY_OF_MONTH));

            return xgc.toXMLFormat();

        } else if (XMLConstants.G_YEAR_QNAME.equals(schemaType)) {
            XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar();
            GregorianCalendar cal = new GregorianCalendar(getTimeZone());
            cal.setGregorianChange(new Date(Long.MIN_VALUE));
View Full Code Here

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

                xgc.setYear(-cal.get(Calendar.YEAR));
            }else{
                xgc.setYear(cal.get(Calendar.YEAR));
            }

            return xgc.toXMLFormat();
        } else if (XMLConstants.G_YEAR_MONTH_QNAME.equals(schemaType)) {
            XMLGregorianCalendar xgc = getDatatypeFactory().newXMLGregorianCalendar();
            GregorianCalendar cal = new GregorianCalendar(getTimeZone());
            cal.setGregorianChange(new Date(Long.MIN_VALUE));
            cal.setTime(sourceTime);
View Full Code Here

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

            }else{
                xgc.setYear(cal.get(Calendar.YEAR));
            }
            xgc.setMonth(cal.get(Calendar.MONTH)+1);

            return xgc.toXMLFormat();
        } else if (XMLConstants.DURATION_QNAME.equals(schemaType)) {
            throw new IllegalArgumentException();
        } else {
            return stringFromSQLTime(sourceTime);
        }
View Full Code Here

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

        xgc.setHour(cal.get(Calendar.HOUR_OF_DAY));
        xgc.setMinute(cal.get(Calendar.MINUTE));
        xgc.setSecond(cal.get(Calendar.SECOND));

        String string= xgc.toXMLFormat();
        string = appendNanos(string, sourceDate);
        return appendTimeZone(string);
    }

    /**
 
View Full Code Here

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

                xgc.setTimezone(cal.get(Calendar.ZONE_OFFSET) / 60000);
            }
            // gDay
            if (XMLConstants.G_DAY_QNAME.equals(schemaTypeQName)) {
                xgc.setDay(cal.get(Calendar.DATE));
                return xgc.toXMLFormat();
            }
            // gMonth
            if (XMLConstants.G_MONTH_QNAME.equals(schemaTypeQName)) {
                xgc.setMonth(cal.get(Calendar.MONTH) + 1);
                // Note: 'XML Schema:  Datatypes' indicates that the lexical representation is "--MM--"
View Full Code Here

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

            if (XMLConstants.G_MONTH_QNAME.equals(schemaTypeQName)) {
                xgc.setMonth(cal.get(Calendar.MONTH) + 1);
                // Note: 'XML Schema:  Datatypes' indicates that the lexical representation is "--MM--"
                // but the truncated representation as described in 5.2.1.3 of ISO 8601:1988 is "--MM".
                // We always want to return the 1.6 syntax ("--MM").
                String xmlFormat = xgc.toXMLFormat();
                String pre  = xmlFormat.substring(0, 4); // will always be --MM
                String post = "";
               
                // --MM or --MM--
                if (xmlFormat.length() == 4 && xmlFormat.length() == 6) {
View Full Code Here

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

            }
            // gMonthDay
            if (XMLConstants.G_MONTH_DAY_QNAME.equals(schemaTypeQName)) {
                xgc.setMonth(cal.get(Calendar.MONTH) + 1);
                xgc.setDay(cal.get(Calendar.DATE));
                return xgc.toXMLFormat();
            }
            // gYear
            if (XMLConstants.G_YEAR_QNAME.equals(schemaTypeQName)) {
                if(cal.get(Calendar.ERA) == GregorianCalendar.BC){
                    xgc.setYear(-cal.get(Calendar.YEAR));
View Full Code Here

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

                if(cal.get(Calendar.ERA) == GregorianCalendar.BC){
                    xgc.setYear(-cal.get(Calendar.YEAR));
                }else{
                    xgc.setYear(cal.get(Calendar.YEAR));
                }
                return xgc.toXMLFormat();
            }
            // gYearMonth
            if (XMLConstants.G_YEAR_MONTH_QNAME.equals(schemaTypeQName)) {
                if(cal.get(Calendar.ERA) == GregorianCalendar.BC){
                    xgc.setYear(-cal.get(Calendar.YEAR));
View Full Code Here

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

                    xgc.setYear(-cal.get(Calendar.YEAR));
                }else{
                    xgc.setYear(cal.get(Calendar.YEAR));
                }
                xgc.setMonth(cal.get(Calendar.MONTH) + 1);
                return xgc.toXMLFormat();
            }
            // Date
            if (XMLConstants.DATE_QNAME.equals(schemaTypeQName)) {
                if(cal.get(Calendar.ERA) == GregorianCalendar.BC){
                    xgc.setYear(-cal.get(Calendar.YEAR));
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.