users@jaxb.java.net

Re: attribute restrictions not working

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 28 Mar 2003 10:53:06 -0800

If you want a type-safe enum, change the base type to xsd:NCName. Or you
can apply a <globalBidings> customization and tell the compiler to
recognize xsd:string as one of the type-safe-enum capable base type. I
forgot the exact customization but I'm pretty sure the spec has an
example.

Or you can call the validation and check if the value is OK. It's just
that the generated method signature doesn't enforce any additional
constraint. You can catch all those by using the on-demand validation.

The same thing applies to an integer limited from 1 to 100, etc.


regards,
--
Kohsuke KAWAGUCHI                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com