Technology Preview of JAXB RI 2.0 Early Access
The early access version of the JAXB RI 2.0 is now available. This document explains how you can try it.
- Download the binary and place this file in an empty directory.
Execute the downloaded class file as:
java -cp . wsisampleapp11
Pick your favorite schema, and run
java -jar jaxb-xjc.jar abc.xsd
Compile the generated code with your application code. You need
jaxb-impl.jarin your classpath to do so.
- Run your application. You need the same 3 jars to run your application.
Until we write more documentations, you'll have to learn this by example. First, try compiling several schemas and see the generated code. You'll notice that there are several annotations that are very commonly used (such as XmlElement, XmlAttribute, and XmlRootElement. Try imitating the use of annotations on your class.
To create a JAXBContext from your annotated class, do
JAXBContext.newInstance(MyClass1.class,MyClass2,...). You only need to list classes that are mapped to the root element.
More documents coming soon...
Ask Questions and Tell Us How You Think
Please subscribe to firstname.lastname@example.org from here, and send us your comments/questions/bugs/feedbacks. We are listening!