users@jaxb.java.net

Re: Getting Enumerations using API

From: Brandon Franklin <brandon_at_thoughtriver.com>
Date: Tue, 13 May 2003 23:12:16 +0930

Sweeeeet. I've added that RFE to my Watch List. :-) That'll be a most
welcome enhancement.

I was actually going to suggest the use of the 1.5-style generics, but
figured there'd be a desire to keep the code backwards-compatible, so I kept
that to myself. Glad to hear you guys are looking to head that direction
anyway, because that's a much more ideal solution if you ask me.

I'll be looking forward to it!

-Brandon
 Thought River South


----- Original Message -----
From: "Ryan Shoemaker - JavaSoft East" <Ryan.Shoemaker_at_Sun.COM>
To: <JAXB-INTEREST_at_JAVA.SUN.COM>
Sent: Tuesday, May 13, 2003 11:01 PM
Subject: Re: Getting Enumerations using API


> 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
>