users@jaxb.java.net

Re: Anonymous simple types as enums?

From: Felipe Gaúcho <fgaucho_at_gmail.com>
Date: Wed, 25 Feb 2009 16:07:31 +0100

for a complete example, you can checkout my code:

svn checkout https://footprint.dev.java.net/svn/footprint/trunk
footprint --username your.java.net.login

and then just run the ant file in the footprint-core module..

you will find the XSD schemas in the folder "resources/schema"

and the generated types in the folder "generated"



On Wed, Feb 25, 2009 at 4:01 PM, Felipe Gaúcho <fgaucho_at_gmail.com> wrote:
> remove the element tag.. use only the simple type, like in this example:
>
>>                <xsd:simpleType name="Product">
>>                        <xsd:restriction base="xsd:string">
>>                                <xsd:enumeration value="Product1"/>
>>                                <xsd:enumeration value="Product2"/>
>>                                <xsd:enumeration value="Product3"/>
>>                        </xsd:restriction>
>>                </xsd:simpleType>
>
> and then jaxb will generate an Enum..
>



-- 
Please help to test this application:
http://fgaucho.dyndns.org:8080/cejug-classifieds-richfaces