Class Binding Declarations
Class Binding Declarations
Class Binding Declarations
The following code shows the class binding declarations in po.xsd:
<xsd:complexType name=
"PurchaseOrderType">
<xsd:annotation>
<xsd:appinfo>
<jxb:class name=
"POType">
<jxb:javadoc>
A <b>Purchase Order</b> consists of addresses and items.
</jxb:javadoc>
</jxb:class>
</xsd:appinfo>
</xsd:annotation>
.
.
.
</xsd:complexType>
The Javadoc tool annotations for the schema-derived POType class will contain the description
"A <b>Purchase Order</b> consists of addresses and items." The < is used to
escape the opening bracket on the <b> HTML tags.
Note
When a <class> customization is specified in the appinfo element of a complexType
definition, as it is here, the complexType definition is bound to a Java content interface.
Later in po.xsd, another <javadoc> customization is declared at this class level, but this time
the HTML string is escaped with CDATA:
<xsd:annotation>
<xsd:appinfo>
<jxb:class>
<jxb:javadoc>
<![CDATA[ First line of documentation for a <b>USAddress</b>.]]>
</jxb:javadoc>
</jxb:class>
</xsd:appinfo>
</xsd:annotation>
Note
If you want to include HTML markup tags in a <jaxb:javadoc> customization, you must
enclose the data within a CDATA section or escape all left angle brackets using <. See
for more
information.
Customizing JAXB Bindings
Chapter 17 · Binding between XML Schema and Java Classes
529