JavaTM Architecture for XML Binding
JAXB RI Vendor Extensions
Customizations

Specification Version: 2.0
Reference Implementation (RI) Version: 2.0 ea3

JAXB 2.0: Release Notes | XJC | XJCTask | SchemaGen | schemagenTask | Sample Apps | Changelog
JAXB 1.0.x: Release Notes | Changelog
JAXB RI Extensions: Runtime Properties | XJC Customizations | Develop Plugins
JAXB RI Schema Languages: W3C XML Schema | RELAX NG | DTD
JAXB Community: Java.net Homepage | Developer interest list | FAQ

Customizations

The JAXB RI provides additional customizations that are not defined by the JAXB specification. Note the following:

Index of Customizations

Extending a Common Super Class

The <xjc:superClass> customization allows you to specify the fully qualified name of the Java class that is to be used as the super class of all the generated implementation classes. The <xjc:superClass> customization can only occur within your <jaxb:globalBindings> customization on the <xs:schema> element and will only be allowed when xjc is run with the "-extension" switch:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
           xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
           jaxb:extensionBindingPrefixes="xjc"
           jaxb:version="1.0">

    <xs:annotation>
       <xs:appinfo>
          <jaxb:globalBindings>
           <xjc:superClass name="org.acme.RocketBooster"/>
          </jaxb:globalBindings>
       </xs:appinfo>
    </xs:annotation>
.
.
.
</xs:schema>
		

In the sample above, the <xjc:superClass> customization will cause all of the generated implementation classes to extend the named class, org.acme.RocketBooster.

Extending a Common Super Interface

The <xjc:superInterface> customization allows you to specify the fully qualified name of the Java interface that is to be used as the root interface of all the generated interfaces. This customization has no effect unless you are specifically generating interfaces with the <globalBindings generateValueClass="false" switch. The <xjc:superInterface> customization can only occur within your <jaxb:globalBindings> customization on the <xs:schema> element and will only be allowed when xjc is run with the "-extension" switch:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
           xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
           jaxb:extensionBindingPrefixes="xjc"
           jaxb:version="1.0">

    <xs:annotation>
       <xs:appinfo>
          <jaxb:globalBindings generateValueClass="false">
           <xjc:superInterface name="org.acme.RocketBooster"/>
          </jaxb:globalBindings>
       </xs:appinfo>
    </xs:annotation>
.
.
.
</xs:schema>
		

In the sample above, the <xjc:superInterface> customization will cause all of the generated interfaces to extend the named interface, org.acme.RocketBooster.


$Revision: 1.1 $
$Date: 2005/04/15 20:03:05 $