users@jaxb.java.net

Re: ArrayOfFoo

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 12 Apr 2007 11:42:01 -0700

Dan Diephouse wrote:
> Hiya,
>
> I am wondering if its possible to make JAXB generate just List<Foo> instead
> of ArrayOfFoo for schema types like this:
>
> <element name="ArrayOfFoo">
> <complexType>
> <sequence>
> <element name="Foo" type="foo" minOccurrs="0" maxOccurrs="1"
> nillable="true"/>
> </sequence>
> </complexType>
> </element>
>
> Maybe a flag on the <globalBindings/> element?

Yes, this is highly desirable, especially since our schema generator
produces a schema construct like this.

but the problem is that when you just look at this schema, it doesn't
eliminate the possibility that this element is used as the root element,
and so on.

Making XJC smarter is also somewhat difficult because of all the pattern
matching rules and what not.

I think an RFE would be good so that we can keep track.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com