XJC generates static inner classes when you have anonymous complex types
in your schema, e.g.
<element name="MyTag">
<complexType>
..
</complexType>
</element>
In this example, a static inner called MyTag will be generated. It
can't generate a top-level class, because it can't give it a name which
is knows is unique across the schema.
If you want to force generation of top-level classes, then don't use
anonymous complex types:
<element name="MyTag" type="MyType"/>
<complexType name="MyType>
..
</complexType>
This will generate a top-level class called Mytype.
Chet Joswig wrote:
> I have multiple xs:complexTypes that I'd like to be generated as
> top-level classes in Java, but they become inner classes. I've seen
> mention, but very little documentation for the 'localScoping'
> customization, but my generated code is identical whether i use the
> "nested" or "toplevel" option.
>
> My underlying question is identical to this posting and I see that there
> is no solution for JAXB 1.0, but has this changed with 2.0 or 2.1?
>
> https://jaxb.dev.java.net/servlets/ReadMsg?list=users&msgNo=3304
>
> Thanks for any suggestions.
>
> */Chet Joswig <cjoswig_at_yahoo.com>/* wrote:
>
> Is there a global option that I can specify either through Ant or in
> my binding file that will tell xjc to generate top level class names
> as opposed to static inner classes?
> ------------------------------------------------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile.
> Try it now.
> <http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20>
>
>
> ------------------------------------------------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try
> it now.
> <http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >