Hi to all,
some time ago for some tests with (Web Start) Preferences (actually in
work), i tried to serialize some objects that aren't compatible with
the JSONSerializer, like java Exceptions and (the real question of
this mail) java.util.Date ... ok, i know that this behavior is right,
because this is not specified in the json standard (i found many
articles/workaround related to json and javascript, for dates). And
the same for various Calendar types.

So my idea, on adding a sort of handlers in the Serializer (or maybe
only in the JSONSerializer) to handle a specific class, when at
serialization/deserialization an exception occurs for "object not
supported" or something like this ?
In this way, we could also ask the serializer if the given object is
"aliased" or better, "handled" in this case, and by what.
And then, we could also set if/how to handle a null instance of that
object, etc ...

To have an idea, take a look at XStream aliases mechanism:
http://xstream.codehaus.org/tutorial.html
and
http://xstream.codehaus.org/alias-tutorial.html


What do you think ?

Thanks,
Sandro

Reply via email to