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 />

530<br />

<strong>The</strong> global, schema, and package, and most of the class customizations for the Customize Inline<br />

and Datatype Converter examples are identical. Where the Datatype Converter example differs<br />

from the Customize Inline example is in the parseMethod and printMethod used for converting<br />

XML data to the <strong>Java</strong> int data type.<br />

Specifically, rather than using methods in the custom MyDataTypeConverter class to perform<br />

these data type conversions, the Datatype Converter example uses the built-in methods<br />

provided by javax.xml.bind.DatatypeConverter:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Building and Running the Datatype Converter Example Using<br />

NetBeans IDE<br />

Follow these instructions to build and run the Datatype Converter example on your Application<br />

Server instance using NetBeans IDE.<br />

1. In NetBeans IDE, select File→Open Project.<br />

2. In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/jaxb/.<br />

3. Select the datatypeconverter folder.<br />

4. Select the Open as Main Project check box.<br />

5. Click Open Project.<br />

6. Right-click the datatypeconverter project and select Run.<br />

Building and Running the Datatype Converter Example Using Ant<br />

To compile and run the Datatype Converter example using Ant, in a terminal window, go to the<br />

tut-install/javaeetutorial5/examples/jaxb/datatypeconverter/ directory and type the<br />

following:<br />

ant runapp<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

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

Saved successfully!

Ooh no, something went wrong!