Skip to content

JAXB2 AutoInheritance Plugin

Laurent Schoelens edited this page Aug 29, 2023 · 1 revision

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.

Clone this wiki locally