[json-lib-user] to what degree can I customize java-to-json serialization?
Brought to you by:
aalmiray
|
From: Morgan P. <mpa...@ke...> - 2009-01-08 20:23:04
|
Hello,
I'm just getting started with json-lib, and it looks very nice so far. I'm
very happy to see that it was designed with some flexibility/control in
mind, for example the ability to filter out properties using
"setJsonPropertyFilter".
I'd like to go a step further and actually control the way in which some
properties are serialized. For example, I have a property ("startDate")
which is a GregorianCalendar. Rather than serializing the entire contens of
the calendar into json (
{"startDate":{"firstDayOfWeek":1,"gregorianChange":{"date... ), I'd like
to simply populate this property with a string ("startDate" : "Monday,
December 1st" ).
So, I need a way to intercept all instances of GregorianCalendar, and create
my own serialization for them.
Any ideas?
thanks,
-Morgan
|