-
Notifications
You must be signed in to change notification settings - Fork 54
JAXB2 Inheritance Plugin
Laurent Schoelens edited this page Aug 25, 2023
·
4 revisions
Activate the plugin using -Xinheritance
switch.
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
//...
<bindingDirectory>
${basedir}/src/main/resources/....
</bindingDirectory>
<extension>true</extension>
<args>
<arg>-Xinheritance</arg>
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version><---Version---></version>
</plugin>
</plugins>
</configuration>
</execution>
In your bindings.xjb use inheritance:inherit
inside jaxb:bindings
to add java interface to a generated class.
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings version="2.1"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance"
jaxb:extensionBindingPrefixes="xjc">
<jaxb:bindings
schemaLocation="mySchema.wsdl"
node="//xs:complexType[@name='MyType']">
<inheritance:implements>com.application.MyInterface</inheritance:implements>
</jaxb:bindings>
</jaxb:bindings>
-
JAXB2 Basics Plugins
- Using JAXB2 Basics Plugins
- JSR-305 Support
- SimpleEquals Plugin
- SimpleHashCode Plugin
- Equals Plugin
- HashCode Plugin
- ToString Plugin
- Copyable Plugin
- Mergeable Plugin
- Inheritance Plugin
- AutoInheritance Plugin
- Wildcard Plugin
- Setters Plugin
- Simplify Plugin
- EnumValue Plugin
- JAXBIndex Plugin
- FixJAXB1058 Plugin
- Sample Projects