users@jaxb.java.net

Binding of element type to custom class

From: Christian Pich <Christian.Pich_at_qcsi.com>
Date: Thu, 31 Mar 2005 16:00:51 -0700

I cannot figure out how I bind an element (of complex type) to my own
class.

I tried the following annotation:

 

    <xs:complexType name="Payer">

        <xs:annotation>

            <xs:appinfo>

                <jaxb:class name="com.myhealthbank.Payer"/>

            </xs:appinfo>

        </xs:annotation>

        <xs:sequence>

            <xs:element name="name" type="xs:string"/>

            <xs:element name="federalTaxID" type="xs:string"/>

            <xs:element name="code" type="xs:string"/>

            <xs:element ref="Address"/>

        </xs:sequence>

    </xs:complexType>

 

In essence, I'd like to bind the payer type to my class

com.myhealthbank.Payer

instead of having JAXB create a new class in the default package.

How do I do that?

 

Thanks.

Christian