Re: [Simple-support] typesafe enums
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2007-06-09 23:25:18
|
Hi,=0A=0AYes, Java enums are supported, all you need to do is add them to a=
n annotation. For example=0A=0Apublic enum MyEnum {=0A ONE,=0A TWO,=
=0A THREE=0A}=0A=0A@Root=0Apublic class MyExample {=0A=0A @Element=0A =
private MyEnum element;=0A=0A @Attribute=0A private MyEnum attribute;=
=0A}=0A=0AThis can be used with XML like so:=0A=0A<myExample attribute=3D"O=
NE">=0A <element>TWO</element>=0A</myExample>=0A=0AThe Enum.name() method=
is used to determine the exact enum to use. This is bidirectionally serial=
izable.=0A=0ANiall=0A=0A=0A=0A=0A=0A=0A----- Original Message ----=0AFrom: =
Est=EAv=E3o Monteiro <es...@gm...>=0ATo: sim...@li...=
orge.net=0ASent: Saturday, June 9, 2007 12:08:01 PM=0ASubject: [Simple-supp=
ort] typesafe enums=0A=0AHi! Nice work! Simple has greatly helped my projec=
ts both at work and at home!=0A=0AI'd like to ask if there are plans to sup=
port typesafe enums, or if it is already supported. Thanks!=0A=0A----------=
---------------------------------------------------------------=0AThis SF.n=
et email is sponsored by DB2 Express=0ADownload DB2 Express C - the FREE ve=
rsion of DB2 express and take=0Acontrol of your XML. No limits. Just data. =
Click to get it now.=0Ahttp://sourceforge.net/powerbar/db2/=0A_____________=
__________________________________=0ASimple-support mailing list=0ASimple-s=
up...@li...=0Ahttps://lists.sourceforge.net/lists/listinfo=
/simple-support=0A=0A=0A=0A=0A=0A=0A=0A =0A__________________________=
__________________________________________________________=0ANeed a vacatio=
n? Get great deals=0Ato amazing places on Yahoo! Travel.=0Ahttp://travel.ya=
hoo.com/ |