[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: enums, generics and other animals

alesj do-not-reply at jboss.com
Fri Mar 7 09:45:39 EST 2008


"adrian at jboss.org" wrote : 
  | RTFM :-)
  | 
Which FM?

"adrian at jboss.org" wrote : 
  | You can actually do some pretty weird stuff, so don't overuse it ;-)
  | 
  | 
  |   | @XmlEnum(Integer.class)
  |   | public enum OldEnglishMoney
  |   | {
  |   |    @XmlEnumValue("D")
  |   |    PENNY(1),
  |   |    @XmlEnumValue("S")
  |   |    SHILLING(12)
  |   |    @XmlEnumValue("L")
  |   |    POUND(240)
  |   | }
  |   | 
What's so weird here?
Or where is the overuse?

If you know underlying value is a string, almost matching enum name, I guess you can do what I proposed. :-)

And what I could actually do, in a safe manner, is to rename the enums to match the underlying string, and thank IDE for making this possible.
But I'll stick to getInstance. ;-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134867#4134867

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134867



More information about the jboss-dev-forums mailing list