JAXB2 Basic - highsource/jaxb-tools GitHub Wiki
JAXB Plugins (former JAXB2 Basics)
JAXB Plugins is an open source project, part of the JAXB Tools repository, which provides useful plugins and tools for JAXB reference implementation.
Documentation
Using JAXB Plugins
JAXB Plugins - Available plugins
These plugins are available :
- SimpleEquals Plugin - generates runtime-free reflection-free equals(...)methods.
- SimpleHashCode Plugin - generates runtime-free reflection-free hashCode()methods.
- Equals Plugin - generates reflection-free strategic equals(...)method.
- HashCode Plugin - generates reflection-free strategic hashCode()method.
- ToString Plugin - generates reflection-free strategic toString()methods.
- Copyable Plugin - generates reflection-free strategic copy(...)deep copying.
- Mergeable Plugin - generates reflection-free strategic merge(...)methods to merge data from two source objects into the given object.
- Inheritance Plugin - makes schema-derived classes extend certain class or implement certain interfaces.
- Wildcard Plugin - allows you to specify the wildcard mode for the wildcard properties.
- AutoInheritance Plugin - makes classes derived from global elements or complex types extend or implement certain classes or interfaces automatically.
- Setters Plugin - generates setters for collections.
- Simplify Plugin - simplifies weird properties like aOrBOrC.
- EnumValue Plugin - makes all the generated enums implement the EnumValue<T>interface.
- JAXBIndex Plugin - generated jaxb.indexfiles listing schema-derived classes.
- FixJAXB1058 Plugin - fixes JAXB-1058.
New plugins from 2.0.4 version :
- Commons Lang Plugin - generates the toString(),hashCode()andequals()methods using Apache commons-lang3.
- Default Value Plugin - modifies the JAXB code model to set default values to the schema defaultattribute.
- Fluent API Plugin - support a fluent api in addition to the default (JavaBean) setter methods.
- Namespace Prefix Plugin - adds javax.xml.bind.annotation.XmlNs(for JAXB2) orjakarta.xml.bind.annotation.XmlNs(for JAXB 3+) annotations topackage-info.javafiles
- Value Constructor Plugin - generates another constructor, taking an argument for each field in the class and initialises the field with the argument value.
New plugins from 4.0.1 version :
- Boolean Getter Plugin - changes getter methods for boolean from isXXXtogetXXX.
- CamelCase Plugin - changes the way class names are generated to always be in CamelCase..
- XML ElementWrapper Plugin - support @XmlElementWrappercollection generation (without the need of inner class).
- Parent Pointer Plugin - adds a field that points to the parent object
- Property Listener Injector Plugin - generates property change events on each setXXXif specified in the additional generated methods
Credits
- Many thanks to James Annesley for his ideas and help with the JAXB2 SimpleEquals Plugin and the JAXB2 SimpleHashCode Plugin.