users@jaxb.java.net

Re: Getting Enumerations using API

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_sun.com>
Date: Tue, 13 May 2003 09:31:12 -0400

I believe that we have either discussed something like this internally or
on the interest list, although I'm not finding any of the e-mail. Oh, wait,
I just found it - this has already been filed as RFE 4846709.

Go to: http://developer.java.sun.com/developer/bugParade/index.jshtml

and search for bugid 4846709.

Feel free to append additional comments to the RFE if you'd like.

We're going to propose to the JAXB Expert Group that we follow J2SE1.5
typesafe enums. JCP JSR 201 is adding typesafe enum's as first class
citizens into the Java language.

The api's to be added to the typesafe enum design pattern generated by
JAXB should be as close as possible to how the JDK 1.5 enables this
capability. This will ease future migration by JAXB applications from
typesafe enum design pattern to the JDK 1.5 builtin capability for
typesafe enums.

J2SE1.5(Tiger) typesafe enum
http://jcp.org/aboutJava/communityprocess/jsr/tiger/enum.html

  /**
      * Returns an immutable list of all the enum constants in this
      * enum constant's enum class.
      *
      * @return an immutable list of all of the enum constants in this
      * enum constant's enum class.
      */
     public abstract List<T> family();


Thus, recommend following for pre-generics JDK typesafe enum design pattern

/** return immutable list of typesafe enum members. */
public List family();

Please keep in mind that we'd like to track whatever happens in J2SE1.5
for typesafe enum support - we are not planning on snapshotting the API's
shown above.

Since this is an issue for the JAXB Expert Group, it would not be available
until the JAXB Specification is revved to v1.1.

Thanks,

--Ryan