Warning: works with the JAXB 2.1 and not with the JAXB 2.0 included by default in the standard JSDK/JRE 1.6_u3 or earlier (the way I know, starting from Java 1.6 update 4, the standard JSDK/JRE started to pack the JAXB 2.1)!
Requires: the CollectionBeanProperty JAR in the classpath.
Synopsis: -Xinject-prop-listeners [-no-coll-listeners]
-Xinject-prop-listeners - plugin activation option-no-coll-listeners if present, disables the non-Java Beans spec extension of using
org.no0ne.collectionprop.ListProperty to support PropertyChangeEvent generation whenever
the values stored by a list changes. In this case, the plugin will revert in generating
java.util.ArrayList backed list properties, the "natural" way JAXB 2.1 xjc
tool does.org.no0ne.collectionprop.ListProperty never get used),
the generated code will no longer require the presence of CollectionBeanProperty JAR
file in the path as the generated code desn't makes use of the org.no0ne.collectionprop.event.PropertyChangeSupportEx
and/or the correspondent Vetoable one.
Usage example:
xjc.bat -extension -classpath proplistinjector.jar;coll-prop.0.1.1.jar
-Xinject-prop-listeners -d src -p dummy xml-files/jproj.xsd
namespace: http://www.no0ne.org/xjc/plugin/prop-listener-injector
Customization element definitions
<element name="listener-support">
<complexType>
<attribute name="type" default="BOUND">
<simpleType>
<restriction base="string">
<enumeration value="NONE">
<enumeration value="BOUND">
<enumeration value="RESTRICTED">
<enumeration value="BOTH">
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
The customization element may be attached to any of the schema, element, attribute, complex or simple type definition, with the specification that the more specific customzation take precedence (overrides) the less specific one. For example, if the customization at the an_element level requires that BOTH of bound/restricted support to be generated, but the customzation at the an_attr specifies only a BOUND support, then all the other fields corresponding to the attributes will be generated with both bound/restricted support, except the for the anAttr field for each only the bound support is to be generated.
See the xmf-files/jproj.xsd for an example.