Inheritance plugin

Inheritance plugin

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

Activation

Use -Xinheritance argument to activate the plugin.

Usage

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

Example

schema.xsd
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
	xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance"
	jaxb:version="2.1"
	jaxb:extensionBindingPrefixes="inheritance">

	<!-- ... -->

	<xs:annotation>
		<xs:appinfo>
			<jaxb:schemaBindings>
				<jaxb:package name="com.acme.foo" />
			</jaxb:schemaBindings>
			<inheritance:objectFactory packageName="com.acme.foo">
				<inheritance:implements>java.lang.Cloneable</inheritance:implements>
			</inheritance:objectFactory>
		</xs:appinfo>
	</xs:annotation>

	<!-- ... -->

	<xs:complexType name="WillBeMadeCloneableType">
		<xs:annotation>
			<xs:appinfo>
				<inheritance:implements>java.lang.Cloneable</inheritance:implements>
			</xs:appinfo>
		</xs:annotation>
		<!-- ... -->
	</xs:complexType>

	<!-- ... -->

</xs:schema>
bindings.xjb
<jaxb:bindings
	xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance"
	jaxb:extensionBindingPrefixes="inheritance"
	jaxb:version="2.1">

	<jaxb:bindings schemaLocation="schema.xsd" node="/xsd:schema">
		<jaxb:bindings node="xsd:simpleType[@name='issueJIIB38Type']">
			<inheritance:implements>java.lang.Cloneable</inheritance:implements>
		</jaxb:bindings>
		<jaxb:bindings node="xsd:element[@name='issueJIIB38']">
			<jaxb:class/>
			<inheritance:implements>java.lang.Cloneable</inheritance:implements>
		</jaxb:bindings>
	</jaxb:bindings>
</jaxb:bindings>

Browse Space

- Pages
- News
- Labels
- Attachments
- Bookmarks
- Mail
- Activity
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide
- Impressum

Your Account

Log In

 

Other Features

Add Content