[Simple-support] stating the deserialization strategy on a class using annotation
Brought to you by:
niallg
|
From: hatchetman82 <hat...@gm...> - 2011-02-28 06:47:44
|
Hi. we use simple-xml to (de)serialize entity classes for out application's REST api (using resteasy). as part of the RESTeay api, there's an interface called MessageBodyReader responsible for deserializing XML into a java class with the following signature: public Object readFrom(Class type, /* stuff omitted */, InputStream inputStream); deserializing some of our classes requires custom Strategy implementations, which turns the implementation of the above method int a giant switchboard of if-elses according to the type variable. it would be very nice to be able to have some sort of @DeserializationStrategy(value=[some strategy class]) annotation on simple-xml-annotated classes to prevent this scenario. is this possible? if so, is it on the roadmap anywhere? thanks in advance for any assistance, radai. |