JAXB2 Simplify Plugin simplifies complex properties (like xOrYOrZ) which XJC (JAXB schema compiler) sometimes generates.
JAXB2 Simlify plugin is a plugin for jaxb schema compiler xjc which simplifies "weird" properties like xOrYOrZ
which XJC sometimes generates. JAXB2 Simlify plugin is a part of the extensive jaxb2-basics plugins package.
Purpose
If you use XJC to generate Java classes from XML schemas, sometimes instead of the expected properties x
, y
, z
you get something weird-looking like xOrYOrZ
. This happens in a number of cases, for instance with repeatable choices:
<xs:choice maxOccurs="unbounded">
<xs:element name="x" type="..."/>
<xs:element name="y" type="..."/>
<xs:element name="z" type="..."/>
</xs:choice>
Working with such "complex" properties is not convenient. JAXB2 Simlify plugin allows splitting such properties into several "simple" properties (ex. x
, y
, z
).
Usage
- Add jaxb2-basics to the XJC classpath.
- Declare
http://jaxb2-commons.dev.java.net/basic/simplify
as an extension namespace. - Use
simplify:as-element-property
orsimplify:as-reference-property
customization elements to specify, which properties you want to simplify.
Please refer to the full documentation for more information