background image

Basic JAXB Examples

<< JAXB Usage Instructions | Java-toSchema JAXB Examples >>
<< JAXB Usage Instructions | Java-toSchema JAXB Examples >>
D
ESCRIPTION
13
Table 3­1 briefly describes the Basic examples.
Table 3­2 briefly describes the Customize examples.
Table 3­1 Basic JAXB Examples
Example Name
Description
Unmarshal Read Exam-
ple
Demonstrates how to unmarshal an XML document into a Java
content tree and access the data contained within it.
Modify Marshal Exam-
ple
Demonstrates how to modify a Java content tree.
Unmarshal Validate
Example
Demonstrates how to enable validation during unmarshalling.
Pull Parser Example
Demonstrates how to use the StAX pull parser to parse a portion
of an XML document.
Table 3­2 Customize JAXB Examples
Example Name
Description
Customize Inline Exam-
ple
Demonstrates how to customize the default JAXB bindings by
using inline annotations in an XML schema.
Datatype Converter
Example
Similar to the Customize Inline example, this example illustrates
alternate, more terse bindings of XML
simpleType
definitions to
Java datatypes.
External Customize
Example
Illustrates how to use an external binding declarations file to pass
binding customizations for a read-only schema to the JAXB bind-
ing compiler.
Fix Collides Example
Illustrates how to use customizations to resolve name conflicts
reported by the JAXB binding compiler. You should first move
binding.xjb
, the binding file, out of the application directory to
see the errors reported by the JAXB binding compiler, and then
look at
binding.xjb
to see how the errors were resolved. Run-
ning
asant
alone uses the binding customizations to resolve the
name conflicts while compiling the schema.