Child pages
  • Inheritance plugin
Skip to end of metadata
Go to start of metadata

Inheritance plugin

Makes schema-derived classes extend certain class or implement certain interfaces.

Activation

Use -Xinheritance argument to activate the plugin.

Usage

  • Declare the http://jaxb2-commons.dev.java.net/basic/inheritance customization namespace.
  • Use <inheritance:extends>com.acme.foo.MyClass</inheritance:extends> or <inheritance:implements>com.acme.foo.MyInterface</inheritance:implements> customization elements to specify which classes or interfaces should your schema-derived class extend or implement.
  • Use <inheritance:objectFactory packageName="com.acme.foo"/> to customize the object factory class.

Works with class outlines, enum outlines, element and package outlines.

Example

schema.xsd
bindings.xjb

Support for generics

Since 0.6.4 the plugin also supports generics.

Assume you have a generic interface:

You can now use the following customization:

You'll get the following code:

Icon

Parsing of the org.jvnet.jaxb2_commons.tests.issues.IssueJIIB48Interface<java.lang.String> declaration is performed via the excellent JavaParser library.

  • No labels