users@jaxb.java.net

Re: complexType extend an external Java class

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Sat, 03 Oct 2009 14:58:04 -0400

Eric C. wrote:
> I would share my problem :
>
> In my schema file I declare this :
>
> ----------------------------------------------------------------------------------
> <xsd:schema ...
> ...
> <xsd:complexType name="template-transportable">
> <xsd:sequence>
> <xsd:element name="title" type="xsd:string" />
> <xsd:element name="content" type="xsd:base64Binary"
> xmime:expectedContentTypes="application/octet-stream" />
> </xsd:sequence>
> </xsd:complexType>
> ...
> </xsd:schema>
> ----------------------------------------------------------------------------------
>
> When I generate the class TemplateTransportable.java all is ok; but now I
> would like this last one inherits from an existing java class (which is not
> generated by Jaxb).
> For exemple I have a class com.test.Template somewhere, and I would like my
> generated class TemplateTransportable extends com.test.Template.
>
> I have seen when can declare something
> ----------------------------------------------------------------------------------
> <xsd:schema ...
> ...
> <xsd:annotation>
> <xsd:appinfo>
> <jaxb:globalBindings>
> <xjc:superClass name="com.test.Template"/>
> </jaxb:globalBindings>
> </xsd:appinfo>
> </xsd:annotation>
> </xsd:schema>
> ----------------------------------------------------------------------------------
> But it's not good because all my compexType in the schema file will inherit
> from this com.test.Template, it's not my goal, I would to apply on only one
> of my complexType nodes.
>

Hi Eric,

Your question is not clear to me. What do you mean by "I would to apply
on only one of my complexType nodes"?
Specifically, what do you wish to apply? What do you mean by "one of my
complexType nodes"?

Perhaps an example of the desired generated class would help. Thanks.

-- 
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com