Chapter 9. JAXB 2.0
Java Architecture for XML Binding (JAXB) is an API/framework that binds XML schemas to Java representations. JAXB consists of two components: a compiler that compiles an XML schema into an equivalent Java model, and an API that may be used for basic operations such as marshalling and unmarshalling of XML documents. Marshalling an XML document means creating an XML document from Java objects. Unmarshalling means creating a Java representation of an XML document (or, in effect, the reverse of marshalling). JAXB unmarshalling is similar to parsing an XML document using a SAX or a DOM parser, but is easier than parsing. In parsing, first a parser has to be created and subsequently a content handler (for SAX) or a Document Object Model (for DOM) has to be created. JAXB provides a simpler API for accessing an XML document. You may retrieve the element and attribute values of the XML document from the Java representation. JAXB marshalling is similar to serializing a DOM structure...