background image

Class Binding Declarations

<< Schema Binding Declarations | Property Binding Declarations >>
<< Schema Binding Declarations | Property Binding Declarations >>
52
U
SING
JAXB
·
<jxb:javadoc>
specifies customized Javadoc tool annotations for the
primer.myPo
package. Note that, unlike the
<javadoc>
declarations at the
class level, below, the opening and closing
<body>
tags must be included
when the
<javadoc>
declaration is made at the package level.
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 &lt;b>Purchase Order&lt;/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 &lt;b>Purchase Order&lt;/b> consists of addresses
and items."
The
&lt;
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
com-
plexType
definition, as it is here, the
complexType
definition is bound to a Java con-
tent 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>.]]>