JAXB

Java Architecture for XML Binding(JAXB) is asoftware frameworkJavathat allowsclassesXMLdevelopers to map Javamarshalobjectsto.NET Frameworkrepresentations. JAXB provides two main features: the ability toJavainto XML and the inverse, i.e. tounmarshalXML back into Java objects. In other words, JAXB allows storing and retrieving data in memory in any XML format, without the need to implement a specific set of XML loading and saving routines for the program's class structure. It is similar toxsd.exeandXmlSerializerin the.

JAXB is particularly useful when the specification is complex and changing. In such a case, regularly changing theXML Schemadefinitions to keep them synchronised with the Java definitions can be time consuming and error-prone.

JAXB is a part of theJava SEAPIsplatform and one of thethe Java EE platformJava Web Services Development PackinWSIT, and is part of the(JWSDP). It is also one of the foundations for.

JAXB 1.0 was developed under theJava Community Process[1]as JSR 31.[2]Reference implementationsIn 2006 JAXB 2.0 was released under JSR 222 and Maintenance Release 2 released in December 2009.CDDL open source licensejava.net for these specifications are available under the CDDL open source license at java.net.

The tool "xjc" can be used to convertXML SchemaRELAX NGand other schema file types (as of Java 1.6,DTDWSDL, XML[3]annotations, andare supported experimentally) to class representations.Classes are marked up usingfromjavax.xml.bind.annotation.*namespace, for example,@XmlRootElementand@XmlElement. XML list sequences are represented by attributes of typejava.util.List. Marshallers and Unmarshallers are created through an instance of JAXBContext.

In addition, JAXB includes a "schemagen" tool that can essentially perform the inverse of "xjc", creating an XML Schema from a set of annotated classes

Last updated

Was this helpful?