Schema-2-Java is the process of compiling one or more schema files into generated Java classes. Here are some of the basic steps for developing an app:
Java-2-Schema is the process of augmenting existing Java classes with the annotations defined in the javax.xml.bind.annotation package so that the JAXB runtime binding framework is capable of performing the un/marshal operations. Here are the basic steps for developing an app:
For more information about this process, see the the Java WSDP Tutorial and the extensive sample application documentation.
To run the sample applications using the supplied Ant build.xml files, follow these steps:
- % <jwsdp.home>/apache-ant/bin/ant -emacs
- repeat for each sample app
- > <jwsdp.home>\apache-ant\bin\ant -emacs
- repeat for each sample app
A few sample applications do not use Ant. For those samples, refer to the included readme.txt files for instructions.
- This sample application is very similar to the inline-customize sample application, but illustrates an easier, but not as robust, <jaxb:javaType> customization.
- This sample application is identical to the datatypeconverter sample application (formerly SampleApp7) except that the binding customizations are contained in an external binding file.
- Another binding customization example that illustrates how to resolve name conflicts. Run "ant fail" first to see the compiler output and then look at binding.xjb to see how the errors were resolved. Running "ant" will use the binding customizations to resolve the name conflicts while compiling the schema.
- This sample application demonstrates how to customize the default binding produced by the XJC binding compiler.
- This example illustrates java to schema databinding. It demonstrates marshalling and unmarshalling of JAXB annotated classes. Additionally, it demonstrates how to enable JAXP 1.3 validation at unmarshal time using a schema file generated from the JAXB mapped classes.
- This sample application demonstrates how to modify a java content tree and marshal it back to XML data.
- In this example, the input document will be unmarshalled a small chunk at a time, instead of unmarshalling the whole document at once.
- This sample app demonstrates how a pull-parser (SJSXP) can be used with JAXB to increase the flexibility of processing.
- This sample application processes a UBL order instance and writes a report to the screen.
- This sample application demonstrates how to unmarshal an instance document into a Java content tree and access data contained within it.
- This sample application demonstrates how to enable validation during the unmarshal operations.
- This example demonstrates how to use one communication channel (such as a socket) to send multiple XML messages, and how that channel can be combined with JAXB.
- This example demonstrates how the behavior of the marshalling process can be customized. In this example, an <?xml-stylesheet ... ?> processing instruction is inserted into the marshalled document.
Sample applications that illustrate JAXB RI vendor extensions.
- This example shows how you can use the new JAXB RI Marshaller property "com.sun.xml.bind.characterEscapeHandler" to change the default character escaping behavior.
- This sample application illustrate some of the DTD support available in the JAXB RI's extension mode. Please refer to the Vendor Extensions page for more detail.
- This sample application illustrates how W3C XML Schema substitution groups are supported in JAXB RI's extension mode. Please refer to the Vendor Extensions page for more detail.
- This sample application demonstrates how to use the new JAXB RI Marshaller property "com.sun.xml.bind.namespacePrefixMapper" to customize the namespace prefixes generated during marshalling.
- This sample app demonstrates type substitution using the W3C XML Schema Part 0: Primer international purchase order schema.