background image

Schema-Derived JAXB Classes

<< Schema-to-Java Bindings | ObjectFactory Class >>
<< Schema-to-Java Bindings | ObjectFactory Class >>

Schema-Derived JAXB Classes

TABLE 17­13
Schema-to-Java Bindings for the Basic Examples
(Continued)
XML Schema
JAXB Binding
<xsd:simpleType name=
"SKU">
<xsd:restriction base=
"xsd:string">
<xsd:pattern value=
"\d{3}-[A-Z]{2}"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Schema-Derived JAXB Classes
The sections that follow briefly explain the functions of the following individual classes
generated by the JAXB binding compiler for the Basic examples:
"Comment Class" on page 508
"Items Class" on page 508
"ObjectFactory Class" on page 509
"PurchaseOrder Class" on page 509
"PurchaseOrderType Class" on page 510
"USAddress Class" on page 510
Comment
Class
In Comment.java:
The Comment class is part of the primer.po package.
Comment
is a public interface that extends javax.xml.bind.Element.
Content in instantiations of this class binds to the XML schema element named comment.
The getValue() and setValue() methods are used to get and set strings representing XML
comment
elements in the Java content tree.
Items
Class
In Items.java:
The Items class is part of the primer.po package.
The class provides public interfaces for Items and ItemType.
Content in instantiations of this class binds to the XML ComplexTypes Items and its child
element ItemType.
Item
provides the getItem() method.
ItemType
provides methods for:
getPartNum();
JAXB Examples
The Java EE 5 Tutorial · September 2007
508