background image

Binding XML Schema and Java Classes

<< Web Services Interoperability | The JAXB Binding Process >>
<< Web Services Interoperability | The JAXB Binding Process >>

Binding XML Schema and Java Classes

Binding between XML Schema and Java Classes
The Java
TM
Architecture for XML Binding (JAXB) provides a fast and convenient way to bind
between XML schemas and Java representations, making it easy for Java developers to
incorporate XML data and processing functions in Java applications. As part of this process,
JAXB provides methods for unmarshalling XML instance documents into Java content trees,
and then marshalling Java content trees back into XML instance documents. JAXB also
provides a way to generate XML schema from Java objects.
JAXB 2.0 includes several important improvements to JAXB 1.0:
Support for all W3C XML Schema features. (JAXB 1.0 did not specify bindings for some of
the W3C XML Schema features.)
Support for binding Java-to-XML, with the addition of the javax.xml.bind.annotation
package to control this binding. (JAXB 1.0 specified the mapping of XML Schema-to-Java,
but not Java-to-XML Schema.)
A significant reduction in the number of generated schema-derived classes.
Additional validation capabilities through the JAXP 1.3 validation APIs.
Smaller runtime libraries.
This chapter describes the JAXB architecture, functions, and core concepts, and provides
examples with step-by-step procedures for using JAXB.
JAXB Architecture
This section describes the components and interactions in the JAXB processing model.
Architectural Overview
Figure 17­1
shows the components that make up a JAXB implementation.
17
C H A P T E R
1 7
489