10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Customizing JAXB Bindings<br />

522<br />

■ A declaration<br />

See “MyDatatypeConverter Class” on page 528 for an example of how declarations<br />

and the DatatypeConverterInterface interface are implemented in a custom data type<br />

converter class.<br />

Typesafe Enumeration Binding Declarations<br />

<strong>The</strong> typesafe enumeration declarations provide a localized way to map XML simpleType<br />

elements to <strong>Java</strong> typesafe enum classes. <strong>The</strong>re are two types of typesafe enumeration<br />

declarations you can make:<br />

■ lets you map an entire simpleType class to typesafe enum classes.<br />

■ lets you map just selected members of a simpleType class to<br />

typesafe enum classes.<br />

In both cases, there are two primary limitations on this type of customization:<br />

■ Only simpleType definitions with enumeration facets can be customized using this binding<br />

declaration.<br />

■ This customization only applies to a single simpleType definition at a time. To map sets of<br />

similar simpleType definitions on a global level, use the typesafeEnumBase attribute in a<br />

declaration, as described in “Global Binding Declarations” on page 517.<br />

<strong>The</strong> syntax for the customization is:<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!