Introduction to JAXB

Java Architecture for XML Binding (JAXB) is an API that specifies the mapping between XML documents and Java objects. JAXB defines a mechanism for creating Java objects from an XML document. Similarly, JAXB also enables generating XML documents from Java objects. These features allow you to work with XML without having to know XML programming techniques.

Moreover, your application need not depend on resource-intensive and complex XML processing models, such as DOM and SAX. This is because JAXB enables you to create Java objects that take less memory space. For example, consider a DOM tree that represent an XML document, which represents a tree structure in the memory with all the fields as the leaf nodes. This tree structure will take more memory than a Java class with corresponding fields.

The graphic shows how JAXB maps XML document and Java objects.
Click the Next button to continue.