Binding XML Schemas
This section describes the default XML-to-Java bindings used by JAXB. All of these bindings can be overridden on global or case-by-case levels by means of a custom binding declaration. The topics in this section are as follows:
See the JAXB Specification for complete information about the default JAXB bindings.
Simple Type Definitions
A schema component using a simple type definition typically binds to a Java property. Since there are different kinds of such schema components, the following Java property attributes (common to the schema components) include:
The rest of the Java property attributes are specified in the schema component using the
simple
type definition.Default Data Type Bindings
The Java language provides a richer set of data type than XML schema. Table 1-3 lists the mapping of XML data types to Java data types in JAXB.
Default Binding Rules Summary
The JAXB binding model follows the default binding rules summarized below:
- Bind the following to Java package:
- Bind the following XML Schema components to Java content interface:
- Bind to typesafe enum class:
- Bind the following XML Schema components to a Java Element interface:
- Bind to Java property:
- Bind model group with a repeating occurrence and complex type definitions with mixed
{content type}
to: