pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: JSONSerializer and unsupported objects
Date Wed, 01 Apr 2009 12:54:00 GMT
There are multiple ways we could handle something like this. Can you tell us more about the
specific use case(s) you are attempting to satisfy?
On Wednesday, April 01, 2009, at 08:03AM, "Sandro Martini" <sandro.martini@gmail.com>
>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:
>What do you think ?

View raw message