background image

Schema Binding Declarations

<< globalBindings Declarations | Property Binding Declarations >>
<< globalBindings Declarations | Property Binding Declarations >>

Schema Binding Declarations

given schema or binding declarations file. If one source schema includes or imports a second
source schema, the <globalBindings> declaration must be declared in the first source schema.
Schema Binding Declarations
Schema scope customizations are declared with <schemaBindings>. The syntax for schema
scope customizations is:
<schemaBindings>
[ <package> package </package> ]
[ <nameXmlTransform> ... </nameXmlTransform> ]*
</schemaBindings>
<package [ name =
"packageName" ]
[ <javadoc> ... </javadoc> ]
</package>
<nameXmlTransform>
[ <typeName [ suffix=
"suffix" ]
[ prefix=
"prefix" ] /> ]
[ <elementName [ suffix=
"suffix" ]
[ prefix=
"prefix" ] /> ]
[ <modelGroupName [ suffix=
"suffix" ]
[ prefix=
"prefix" ] /> ]
[ <anonymousTypeName [ suffix=
"suffix" ]
[ prefix=
"prefix" ] /> ]
</nameXmlTransform>
As shown above, <schemaBinding> declarations include two subcomponents:
<package>...</package>
specifies the name of the package and, if desired, the location of
the API documentation for the schema-derived classes.
<nameXmlTransform>...</nameXmlTransform>
specifies customizations to be applied.
Class Binding Declarations
The <class> binding declaration enables you to customize the binding of a schema element to a
Java content interface or a Java Element interface. <class> declarations can be used to
customize:
A name for a schema-derived Java interface
An implementation class for a schema-derived Java content interface
The syntax for <class> customizations is:
<class [ name =
"className"]
[ implClass=
"implClass" ] >
Customizing JAXB Bindings
Chapter 17 · Binding between XML Schema and Java Classes
521