users@jaxb.java.net

Re: Substituting a type's List property for the type itself

From: Chris Nokleberg <chris_at_sixlegs.com>
Date: Mon, 18 Dec 2006 22:51:25 -0800

I just found this forum thread:
http://forums.java.net/jive/thread.jspa?forumID=46&threadID=20791&messageID=182658#182658

The workaround of overwriting a class isn't feasible for me, as this
issue applies to perhaps a hundred elements.

I'm not sure of all the ramifications, but it seems like you should be
able to annotate a schema complex type as a "wrapper" type. Perhaps
this would only be allowed if the type does not allow attributes. Then
it could do the right thing--avoid generating the unnecessary class
and adding @XmlElementWrapper to all the properties that reference the
type. I'm willing to jump in and attempt to hack up a patch if this
idea is not totally crazy.

Thanks,
Chris

On 12/17/06, Chris Nokleberg <chris_at_sixlegs.com> wrote:
> Many of the elements in the schema have no attributes. Often they are
> just containers for children elements. For example:
[snip]
> Because there are no meaningful attributes I would much prefer to
> eliminate the CTSlideIdList class completely, and just substitute a
> List<CTSlideIdListEntry> everywhere it is currently referenced. There
> is no ambiguity, even going the other way, because CTSlideIdListEntry
> elements are always contained in a CT_SlideIdList. Is this possible?