XML/Java Type Mappings.

javax.xml.datatypeAPI provides XML/Java type mappings.

The following XML standards apply:


W3C XML Schema Data Type Java Data Type
xs:date {@link javax.xml.datatype.XMLGregorianCalendar}
xs:dateTime {@link javax.xml.datatype.XMLGregorianCalendar}
xs:duration {@link javax.xml.datatype.Duration}
xs:gDay {@link javax.xml.datatype.XMLGregorianCalendar}
xs:gMonth {@link javax.xml.datatype.XMLGregorianCalendar}
xs:gMonthDay {@link javax.xml.datatype.XMLGregorianCalendar}
xs:gYear {@link javax.xml.datatype.XMLGregorianCalendar}
xs:gYearMonth {@link javax.xml.datatype.XMLGregorianCalendar}
xs:time {@link javax.xml.datatype.XMLGregorianCalendar}

XQuery 1.0 and XPath 2.0 Data Model Java Data Type
xdt:dayTimeDuration {@link javax.xml.datatype.Duration}
xdt:yearMonthDuration {@link javax.xml.datatype.Duration}

W3C XML Schema data types that have a "natural" mapping to Java types are defined by JSR 31: Java™ Architecture for XML Binding (JAXB) Specification, Binding XML Schema to Java Representations. JAXB defined mappings for XML Schema built-in data types include: