users@jaxb.java.net

How to specify base type for a complexType

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Wed, 10 Dec 2008 10:51:48 -0500

I have a compledxType hierarchy in my xsd that I would like to map to an
Exception type hierachy in the generated bindings.

Here is a sample of the xsd type hierarchy:

<complexType name="RegistryExceptionType">
</complexType>

<complexType name="AuthenticationExceptionType">
     <complexContent>
         <extension base="tns:RegistryExceptionType">
             <sequence/>
         </extension>
     </complexContent>
</complexType>


I tried specifying the following customization:

<jaxb:bindings node="xs:complexType[@name='RegistryExceptionType']">
     <jaxb:property>
       <jaxb:baseType name="java.lang.Exception"/>
     </jaxb:property>
</jaxb:bindings>

However, the generated class for RegistryExceptionType still did not
extend java.lang.Exception as expected.

What am I doing wrong?

Thanks.

--
Farrukh