background image

About the Schema-to-Java Bindings

<< JAXB Schema Generator Options | JAXB Classes in the Basic Examples >>
<< JAXB Schema Generator Options | JAXB Classes in the Basic Examples >>
A
BOUT THE
S
CHEMA
-
TO
-J
AVA
B
INDINGS
19
About the Schema-to-Java Bindings
When you run the JAXB binding compiler against the
po.xsd
XML schema
used in the basic examples (Unmarshal Read, Modify Marshal, Unmarshal Vali-
date), the JAXB binding compiler generates a Java package named
primer.po
containing eleven classes, making a total of twelve classes in each of the basic
examples:
Table 3­6 Schema-Derived JAXB Classes in the Basic Examples
Class
Description
primer/po/
Comment.java
Public interface extending
javax.xml.bind.Element
;
binds to the global schema
element
named
comment
. Note
that JAXB generates element interfaces for all global element
declarations.
primer/po/
Items.java
Public interface that binds to the schema
complexType
named
Items
.
primer/po/
ObjectFactory.java
Public class extending
com.sun.xml.bind.DefaultJAXB-
ContextImpl
; used to create instances of specified inter-
faces. For example, the
ObjectFactory createComment()
method instantiates a
Comment
object.
primer/po/
PurchaseOrder.java
Public interface extending
javax.xml.bind.Element
, and
PurchaseOrderType
; binds to the global schema
element
named
PurchaseOrder
.
primer/po/
PurchaseOrderType.java
Public interface that binds to the schema
complexType
named
PurchaseOrderType
.
primer/po/
USAddress.java
Public interface that binds to the schema
complexType
named
USAddress
.
primer/po/impl/
CommentImpl.java
Implementation of
Comment.java
.
primer/po/impl/
ItemsImpl.java
Implementation of
Items.java
primer/po/impl/
PurchaseOrderImpl.java
Implementation of
PurchaseOrder.java