background image

javadoc Binding Declarations

<< Typesafe Enumeration Binding Declarations | Customize Inline Example >>
<< Typesafe Enumeration Binding Declarations | Customize Inline Example >>

javadoc Binding Declarations

For inline annotations, the <typesafeEnumClass> declaration must be specified in the
annotation element of the <simpleType> element. The <typesafeEnumMember> must be
specified in the annotation element of the enumeration member. This allows the enumeration
member to be customized independently from the enumeration class.
For information about typesafe enum design patterns, see the
sample chapter of Joshua Bloch's
Effective Java Programming on the Java Developer Connection
(http://developer.java.sun.com/
developer/Books/shiftintojava/page1.html#replaceenums
)
.
javadoc Binding Declarations
The <javadoc> declaration lets you add custom Javadoc tool annotations to schema-derived
JAXB packages, classes, interfaces, methods, and fields. Note that <javadoc> declarations
cannot be applied globally; they are only valid as sub-elements of other binding customizations.
The syntax for the <javadoc> customization is:
<javadoc>
Contents in &lt;b>Javadoc&lt;\b> format.
</javadoc>
or
<javadoc>
<<![CDATA[
Contents in <b>Javadoc<\b> format
]]>
</javadoc>
Note that documentation strings in <javadoc> declarations applied at the package level must
contain <body> open and close tags; for example:
<jxb:package name=
"primer.myPo">
<jxb:javadoc>
<![CDATA[<body>Package level documentation for generated package primer.myPo.</body>]]>
</jxb:javadoc>
</jxb:package>
Customization Namespace Prefix
All standard JAXB binding declarations must be preceded by a namespace prefix that maps to
the JAXB namespace URI (
http://java.sun.com/xml/ns/jaxb
). For example, in this sample,
jxb:
is used. To this end, any schema you want to 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
declaration is as follows:
Customizing JAXB Bindings
Chapter 17 · Binding between XML Schema and Java Classes
525