users@jaxb.java.net

Re: typesafe Enumeration

From: Joe Fialli <joseph.fialli_at_sun.com>
Date: Mon, 11 Nov 2002 12:11:08 -0500

Sam wrote:
> I m confused about Enumeration
> As per 5.2.3.1 When I run xjc on
> <xsd:simpleType name="USState"
> <xsd:restrictionbase="xsd:string">
> <xsd:enumeration value="AK"/>
> <xsd:enumeration value="AL"/>
> </xsd:restriction>
> </xsd:simpleType>
>
> I just get an interface with get/set Value methods. Where does the
> typesafe enum fit in ??

By default, only XML enums that derive from restriction basetype
"xsd:NCName" map to typesafe Enum by default.

The customization section (Section 6) in v0.75 specification describes
how to change the default binding and how to customize a specific
XML enum simple typedef to bind to a typesafe enum

-Joe Fialli, Sun Microsystems

>
> /s


--