users@jaxb.java.net

Re: Getting a Java 5 enum from XJC

From: Gregory Kick <gk5885_at_gmail.com>
Date: Thu, 25 Jan 2007 16:43:36 -0800

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
>


-- 
Gregory Kick
gk5885_at_gmail.com