background image

JAXB Usage Instructions

<< 3. Using JAXB | Basic JAXB Examples >>
<< 3. Using JAXB | Basic JAXB Examples >>
12
U
SING
JAXB
Note: The Purchase Order schema,
po.xsd
, and the Purchase Order XML file,
po.xml
, used in the Basic and Customize samples are derived from the W3C XML
Schema Part 0: Primer (
http://www.w3.org/TR/xmlschema-0/
), edited by
David C. Fallside.
General Usage Instructions
This section provides general usage instructions for the examples used in this
chapter, including how to build and run the applications using the Ant build tool,
and provides details about the default schema-to-JAXB bindings used in these
examples.
Description
This chapter describes three sets of examples:
· The Basic examples (Unmarshal Read, Modify Marshal, Unmarshal Vali-
date, Pull Parser) demonstrate basic JAXB concepts like ummarshalling,
marshalling, validating XML content, and parsing XML data.
· The Customize examples (Customize Inline, Datatype Converter, External
Customize, Fix Collides) demonstrate various ways of customizing the
binding of XML schemas to Java objects.
· The Java-to-Schema examples show how to use annotations to map Java
classes to XML schema.
The Basic and Customize examples are based on a Purchase Order scenario.
With the exception of the Fix Collides example, each uses an XML document,
po.xml
, written against an XML schema,
po.xsd
.