Customizing JAXB Bindings

The following section describes several examples that build on the concepts demonstrated in the Basic examples.

The goal of this section is to illustrate how to customize JAXB bindings using custom binding declarations, made in one of the following two ways:

Unlike the examples in Basic JAXB Examples, which focus on the Java code in the respective Main.java class files, the examples here focus on customizations made to the XML schema before generating the schema-derived Java binding classes.

Note: JAXB binding customizations currently must be made by hand. One of the goals of the JAXB technology is to standardize the format of binding declarations, thereby making it possible to create customization tools and to provide a standard interchange format between JAXB implementations.

This section introduces customizations that can be made to JAXB bindings and validation methods. For more information, see JAXB Specification.

Why Customize?

In most cases, the default bindings generated by the JAXB binding compiler are sufficient. There are cases, however, in which you might want to modify the default bindings. Some of these include: