JAXB2 AutoInheritance Plugin - highsource/jaxb-tools GitHub Wiki

AutoInheritance Plugin

AutoInheritance plugin allows you to force global elements or complex types to extend or implement certain classes or interfaces. Activation

The plugin is activated by the -XautoInheritance and configured by the corresponding command line options.

  • -XautoInheritance-xmlRootElementsExtend
  • -XautoInheritance-xmlRootElementsImplement
  • -XautoInheritance-jaxbElementsImplement
  • -XautoInheritance-xmlTypesExtend
  • -XautoInheritance-xmlTypesImplement

Usage

This will make all global elements (classes annotated with @XmlRootElement) extend the com.acme.foo.MyElement class and implement com.acme.foo.MyElementInterface1 and com.acme.foo.MyElementInterface2 interfaces (and analogous for generated JAXBElement subclasses the classes annotated with @XmlType).

Note that if your target class already has a superclass, xmlRootElementsExtend or xmlTypesExtend will have no effect.