[Simple-support] A question about enum
Brought to you by:
niallg
|
From: Hong <h...@hz...> - 2012-06-01 17:15:44
|
Hi all,
I apologize if this rudimentary question has been asked before.
I am trying to figure out how to serialize enum values to something
different than their face values.
For example, for the following enum
enum Foo
{
MyFoo,
YourFoo
}
I want to serialize it to "My-Foo" and "Your-Foo".
It seems that SimpleXML does not like the following:
enum Foo
{
MyFoo{
public String toString() {
return "My-Foo";
}
},
YourFoo{
public String toString() {
return "Your-Foo";
}
};
}
Any tip will be greatly appreciated.
Hong
|