Java Architecture for XML Binding
From Wikipedia, the free encyclopedia
Java Architecture for XML Binding (JAXB) allows Java developers to create and edit XML using familiar Java objects. JAXB is particularly useful when the specification is complex and changing. In such a case, regularly changing the XML Schema definitions to keep them synchronised with the Java definitions can be time consuming and error prone.
JAXB is one of the APIs in the Java EE platform, and is part of the Java Web Services Development Pack (JWSDP). It is also one of the foundations for WSIT.
JAXB 1.0 was developed under the Java Community Process as JSR 31. As of 2006, JAXB 2.0 is being developed under JSR 222. Reference implementations for these specifications are available under the CDDL open source license at java.net.
Contents |
[edit] Default Data Type Bindings
The Java language provides a richer set of data type than XML schema. The table below show lists of mapping of XML data types to Java data types in JAXB.
XML Schema Type | Java Data Type |
---|---|
xsd:string | java.lang.String |
xsd:integer | java.math.BigInteger |
xsd:int | int |
xsd.long | long |
xsd:short | short |
xsd:decimal | java.math.BigDecimal |
xsd:float | float |
xsd:double | double |
xsd:boolean | boolean |
xsd:byte | byte |
xsd:QName | javax.xml.namespace.QName |
xsd:dateTime | javax.xml.datatype.XMLGregorianCalendar |
xsd:base64Binary | byte[] |
xsd:hexBinary | byte[] |
xsd:unsignedInt | long |
xsd:unsignedShort | int |
xsd:unsignedByte | short |
xsd:time | javax.xml.datatype.XMLGregorianCalendar |
xsd:date | javax.xml.datatype.XMLGregorianCalendar |
xsd:g | javax.xml.datatype.XMLGregorianCalendar |
xsd:anySimpleType | java.lang.Object |
xsd:anySimpleType | java.lang.String |
xsd:duration | javax.xml.datatype.Duration |
xsd:NOTATION | javax.xml.namespace.QName |
[edit] See also
- XML data binding
- XMLBeans – A similar and complementary technology to JAXB from BEA Systems
- TopLink – an object to relational and object to XML mapper from Oracle that supports JAXB 1.0
[edit] Articles
[edit] External links
- JAXB home page on Project GlassFish
- previous JAXB home page
- JaxMe – Open source implementation of JAXB under the Apache Software Foundation
- JSR 222 (JAXB 2.0)
- JSR 31 (JAXB 1.0)
- JAXB chapter of the Java EE 5 Tutorial