The xjc Tool : JAXB « XML « Java Tutorial






The xjc tool accepts an XML schema and generates Java classes.

The generated classes contain properties mapped to the XML elements and attributes defined in the schema.

The xjc tool is a part of the Java API for XML Binding (JAXB) API.

The syntax to use the xjc tool is:

xjc [-options ...] <schema_file/URL/dir> ... [-b <bindinfo>] ...
OptionDescription
-extensionAllows vendor extensions.
-b Specifies external binding files.
-d Specifies the directory to store generated files.
-p Specifies the target package.
-classpath Specifies where to find user class files.
-quietSuppresses compiler output.
-helpDisplays help information.


33.9.JAXB
33.9.1.XMLSchema Mapping Annotations
33.9.2.The xjc Tool
33.9.3.Marshal Java object to xml and output to console
33.9.4.Marshal Java object to a file