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.

■ setPartNum(String value);<br />

■ getComment();<br />

■ setComment(java.lang.String value);<br />

■ getUSPrice();<br />

■ setUSPrice(java.math.BigDecimal value);<br />

■ getProductName();<br />

■ setProductName(String value);<br />

■ getShipDate();<br />

■ setShipDate(java.util.Calendar value);<br />

■ getQuantity();<br />

■ setQuantity(java.math.BigInteger value);<br />

ObjectFactory Class<br />

In ObjectFactory.java:<br />

■ <strong>The</strong> ObjectFactory class is part of the primer.po package.<br />

■ ObjectFactory provides factory methods for instantiating <strong>Java</strong> interfaces representing<br />

XML content in the <strong>Java</strong> content tree.<br />

■ Method names are generated by concatenating:<br />

■ <strong>The</strong> string constant create.<br />

■ If the <strong>Java</strong> content interface is nested within another interface, then the concatenation of<br />

all outer <strong>Java</strong> class names.<br />

■ <strong>The</strong> name of the <strong>Java</strong> content interface.<br />

For example, in this case, for the <strong>Java</strong> interface primer.po.Items.ItemType,<br />

ObjectFactory creates the method createItemsItemType().<br />

PurchaseOrder Class<br />

In PurchaseOrder.java:<br />

■ <strong>The</strong> PurchaseOrder class is part of the primer.po package.<br />

■ PurchaseOrder is a public interface that extends javax.xml.bind.Element and<br />

primer.po.PurchaseOrderType.<br />

■ Content in instantiations of this class binds to the XML schema element named<br />

purchaseOrder.<br />

JAXB Examples<br />

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

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

Saved successfully!

Ooh no, something went wrong!