Kenny,
On 1/26/07, Kenny MacLeod <kennym_at_kizoom.com> wrote:
> As you say, XJC will only generated an Enum for a Schema type which has
> a name, i.e. isn't an anonymous nested type. It doesn't generate enum
> types for anonymous schema types - what would it call them?
Wouldn't it be expected that it behave the same as an other anonymous
type? If I have an element named "something" that is an anonymous
simple type, xjc generates an inner class called "Something" that is
equivalent to the class I would get if I had named the simple type
"Something" and referenced it. Why would enums behave differently?
>
> Potentially, this behaviour could be over-riden, causing XJC to
> auto-generate names for anonymous schema types?
Again, why would I need to explicitly specify that enumerations behave
the same as every other simple type? Am I missing something about the
enum that would specifically preclude that behavior?
>
>
> Gregory Kick wrote:
> > Aha! After some experimentation, I found that it just breaks if the
> > simpleType is nested. If I move it outside of the complexType, give
> > it it's own name and try it again, it works. Is this a bug or somehow
> > justified? Let me know and i'll put into the issue tracker.
> >
> > On 1/25/07, Gregory Kick <gk5885_at_gmail.com> wrote:
> >> Thanks for the quick reply!
> >>
> >> Yeah, for some reason i'm getting
> >>
> >> @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
> >> protected String type;
> >>
> >> for
> >>
> >> <xs:complexType name="Class">
> >> <xs:complexContent>
> >> <xs:extension base="kse:Named">
> >> <xs:sequence>
> >> <xs:element name="innerClass" type="kse:Class"
> >> minOccurs="0"
> >> maxOccurs="unbounded"/>
> >> </xs:sequence>
> >> <xs:attribute name="type">
> >> <xs:simpleType>
> >> <xs:restriction base="xs:token">
> >> <xs:enumeration value="annotation"/>
> >> <xs:enumeration value="enum"/>
> >> <xs:enumeration value="class"/>
> >> <xs:enumeration value="interface"/>
> >> <xs:enumeration value="throwable"/>
> >> </xs:restriction>
> >> </xs:simpleType>
> >> </xs:attribute>
> >> </xs:extension>
> >> </xs:complexContent>
> >> </xs:complexType>
> >>
> >> On 1/25/07, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_sun.com> wrote:
> >> >
> >> > Yes, in fact that's the default behavior.
> >> >
> >> > I take it that you aren't seeing it though. Can you paste your schema?
> >> >
> >> > Gregory Kick wrote:
> >> > > Is it possible to have
> >> > > <xs:restriction base="xs:token">
> >> > > <xs:enumeration value="whatever"/>
> >> > > ...
> >> > > </xs:restriction>
> >> > > generate a java 5 enum?
> >> > >
> >> >
> >> >
> >> > --
> >> > Kohsuke Kawaguchi
> >> > Sun Microsystems kohsuke.kawaguchi_at_sun.com
> >> >
> >> >
> >> >
> >>
> >>
> >> --
> >> Gregory Kick
> >> gk5885_at_gmail.com
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
--
Gregory Kick
gk5885_at_gmail.com