The task is as follows. We have a number of Java classes which represent the purchase order schema. The goal is to make them work with JAXB without annotating them.
Here's how to solve this task.
First of all we need to create XML resources for our classes. In this sample we have the following classes:
For demonstration purposes I'll put definitions for the first four classes in a common org/jvnet/annox/samples/po/package-info.ann.xml resource and the last class in his own org/jvnet/annox/samples/po/Items$Item.ann.xml resource.
To read annotations from these XML resource I only need to configure JAXB context with an instance of the AnnoxAnnotationReader:
You may download the Ant or Maven distribution of the purchase order sample from the download page.