JAXB Property Listener Injector Plugin - highsource/jaxb-tools GitHub Wiki
This XJC plugin will generate property change events on each setXXX
if specified in the additional generated methods.
Added in 4.0.1 version of JAXB-Tools.
Usage
- Activate the plugin using the
-Xinject-listener-code
switch.
You can customize the PropertyListener
by declaring urn:jaxb.jvnet.org:plugin:propertyListenerInjector
as an extension namespace.
<jaxb:bindings ...
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:li="urn:jaxb.jvnet.org:plugin:propertyListenerInjector"
jaxb:extensionBindingPrefixes="... li">
...
<jaxb:bindings node="/xsd:schema">
<li:listener>java.beans.PropertyChangeListener</li:listener>
</jaxb:bindings>
...
</jaxb:bindings>
Accepted listeners are java.beans.VetoableChangeListener
(default) or java.beans.PropertyChangeListener
.
See also Using JAXB2 Basics Plugins.