Customize Inline Example
C
USTOMIZE
I
NLINE
E
XAMPLE
49
customize with standard JAXB binding declarations must include the JAXB
namespace declaration and JAXB version number at the top of the schema file.
For example, in
po.xsd
for the Customize Inline example, the namespace decla-
ration is as follows:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
jxb:version="1.0">
A binding declaration with the
jxb
namespace prefix would then take the form:
<xsd:annotation>
<xsd:appinfo>
<jxb:globalBindings binding declarations />
<jxb:schemaBindings>
.
.
binding declarations
.
.
</jxb:schemaBindings>
</xsd:appinfo>
</xsd:annotation>
Note that in this example, the
globalBindings
and
schemaBindings
declara-
Customize Inline Example
The Customize Inline example illustrates some basic customizations made by
means of inline annotations to an XML schema named
po.xsd
. In addition, this
example implements a custom datatype converter class,
MyDatatypeCon-
verter.java
, which illustrates print and parse methods in the
<javaType>
cus-
tomization for handling custom datatype conversions.
To summarize this example:
1.
po.xsd
is an XML schema containing inline binding customizations.
2.
MyDatatypeConverter.java
is a Java class file that implements print and
parse methods specified by
<javaType>
customizations in
po.xsd
.