Summary
JDeveloper 11g provides a JAXB 2.0 compiler with which an XML schema may be compiled to its Java representation containing annotations. In this chapter we compiled an XML schema to Java classes using the JAXB compiler. Subsequently, we marshalled the Java classes to an XML document and also unmarshalled an XML document. JAXB 2.0's new features reduce the code generated from a schema with the schema binding compiler and make use of JDK 5.0 features such as annotations and parameterized types. With its support for annotations, JAXB 2.0 provides bi-directional mapping between XML schema, and Java objects; an annotated class hierarchy may be mapped to an XML schema. Generic types provide compile-time type checking, which means that runtime exceptions do not get generated. In the next chapter we will compare XML documents using the XDK 11g API.