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.

...<br />

binding-declarations<br />

...<br />

<br />

<br />

<br />

Class Declarations<br />

<strong>The</strong> class-level binding declarations in bindings.xjb differ from the analogous declarations in<br />

po.xsd for the Datatype Converter example in two ways:<br />

■ As with all other binding declarations in bindings.xjb, you do not need to embed your<br />

customizations in schema elements.<br />

■ You must specify the schema node to which the customization will be applied. <strong>The</strong> general<br />

syntax for this type of declaration is:<br />

<br />

For example, the following code shows binding declarations for the complexType named<br />

USAddress.<br />

<br />

<br />

<br />

USAddress.]]><br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Customizing JAXB Bindings<br />

Note in this example that USAddress is the parent of the child elements name and zip, and<br />

therefore a tag encloses the bindings declarations for the child elements as<br />

well as the class-level javadoc declaration.<br />

Chapter 17 • Binding between XML Schema and <strong>Java</strong> Classes 533

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

Saved successfully!

Ooh no, something went wrong!