JAXB (Java Architecture for XML Binding) is a framework to marshal Java objects to XML and vice-versa.
It is part of the JDK and comes with a command-line compiler (xjc
) that creates Java classes from an existing XML-Schema.
Location
The xjc it located at the /bin folder of the JDK:
../jdk1.6.0_18/bin/xjc.exe
Usage
xjc -d [target folder] -p [package name] [xml-schema file name]
Example
The classes will be written to the folder “src” (relative to the current location) in the package “de.myproject.somepackage”.
The schema file “my-schema.xsd” will be compiled.
xjc -d src -p de.myproject.somepackage my-schema.xsd
For more information see
xjc -help
Carlton Spader
I like this post, enjoyed this one thanks for posting .