Java Code Examples for javax.xml.datatype.DatatypeConstants#GYEAR

The following examples show how to use javax.xml.datatype.DatatypeConstants#GYEAR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XMLGregorianCalendarImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}
 
Example 2
Source File: XMLGregorianCalendarImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}
 
Example 3
Source File: XMLGregorianCalendarImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}
 
Example 4
Source File: XMLGregorianCalendarImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}
 
Example 5
Source File: XMLGregorianCalendarImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}
 
Example 6
Source File: XMLGregorianCalendarImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}
 
Example 7
Source File: XMLGregorianCalendarImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}
 
Example 8
Source File: XMLGregorianCalendarImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}
 
Example 9
Source File: XMLGregorianCalendarImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}
 
Example 10
Source File: XMLGregorianCalendarImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}
 
Example 11
Source File: XMLGregorianCalendarImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <p>Return the lexical representation of <code>this</code> instance.
 * The format is specified in
 * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
 * <i>Lexical Representation</i>".</a></p>
 *
 * <p>Specific target lexical representation format is determined by
 * {@link #getXMLSchemaType()}.</p>
 *
 * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
 *
 * @throws java.lang.IllegalStateException if the combination of set fields
 *    does not match one of the eight defined XML Schema builtin date/time datatypes.
 */
public String toXMLFormat() {

    QName typekind = getXMLSchemaType();

    String formatString = null;
    // Fix 4971612: invalid SCCS macro substitution in data string
    //   no %{alpha}% to avoid SCCS macro substitution
    if (typekind == DatatypeConstants.DATETIME) {
        formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.DATE) {
        formatString = "%Y-%M-%D" + "%z";
    } else if (typekind == DatatypeConstants.TIME) {
        formatString = "%h:%m:%s" + "%z";
    } else if (typekind == DatatypeConstants.GMONTH) {
        formatString = "--%M" + "%z";
    } else if (typekind == DatatypeConstants.GDAY) {
        formatString = "---%D" + "%z";
    } else if (typekind == DatatypeConstants.GYEAR) {
        formatString = "%Y" + "%z";
    } else if (typekind == DatatypeConstants.GYEARMONTH) {
        formatString = "%Y-%M" + "%z";
    } else if (typekind == DatatypeConstants.GMONTHDAY) {
        formatString = "--%M-%D" + "%z";
    }
    return format(formatString);
}