This document describes how to write a JAXB RI plugin to extend the code generation of the JAXB RI.
A JAXB RI plugin participates in the code generation from a schema. It can define its own customizations that users can use to control it, it can access the code that the JAXB RI generates, and it can generate additional classes/methods/fields/annotations/comments.
As a show case of what a plugin can do, take a look at HyperJAXB and JAXB-verification projects.
To write a plugin, do the following simple steps.
Users can then use your plugins by declaring an XJC ant task with your jar files.
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask"> <classpath> <fileset dir="jaxb-ri/lib" includes="*.jar" /> <fileset dir="your-plugin" includes="*.jar" /> </classpath> </taskdef>
Although we will do our best to maintain the compatibility of the interfaces, it is still subject to change at this point.