users@jaxb.java.net

Re: anonymous complex type

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 02 Jun 2003 08:21:59 -0700

Saurabh Arora <sarora_at_novell.com> wrote:
> Is it possible not to generate anonymous complex types.

I agree that it would have made sense, but you can't do that with JAXB
1.0. And since a lot of other bindings now depend on the assumption that
all the complex types will be mapped to classes, I guess it would be
hard to do that.


>
> I have a simple xsd as below,
>
> <xsd:element name="A" >
> <xsd:complexType >
> <xsd:attribute name="ID" type="xsd:string"
> use="required"/>
> <xsd:attribute name="cost" type="xsd:string"
> use="required"/>
> </xsd:complexType>
> </xsd:element>
>
>
> I endup getting classes like
>
> A and AType,
>
> where class A is like
>
> public interface A
> extends javax.xml.bind.Element, primer.po.AType
> {
>
>
> }
>
>
> which means we can effectively move all logic to A and remove AType.
>
> Is it possible to do the same.
> Some kind of global mappings, since i want to do for all complexType.
>
> with regards,
>
> saurabh arora


regards,
--
Kohsuke KAWAGUCHI                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com