Re: [Simple-support] A question about enum
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2012-06-02 02:24:19
|
Take a look at EnumTransform, you can create a transform for enums and register it with the persister. It will handle transformation of the enum values.
--- On Fri, 1/6/12, Hong <h...@hz...> wrote:
From: Hong <h...@hz...>
Subject: [Simple-support] A question about enum
To: sim...@li...
Received: Friday, 1 June, 2012, 10:02 AM
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
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|