how to access my custom annotations when deserializing custom type

133 views
Skip to first unread message

Andy

unread,
Nov 5, 2010, 5:54:15 AM11/5/10
to google-gson
Hi,

I would like to take my custom annotation into account when
deserializing an instance of the following class:

class MyClass {
private int value1 = 1;
private String value2 = "abc";

@MyAnnotation
@SomeOtherAnnotationThatSpecifiesACustomFormatting
private SomeType value3;
}

Is this possible?

Best regards,
Andy.

inde...@gmail.com

unread,
Nov 26, 2010, 2:00:59 PM11/26/10
to google-gson
At the moment, there is no way to register a custom action for a
specific annotation.
However, that seems like a really useful thing. I have added that as
one of the things we would look to support in Gson 1.7.
Subscribe to the bug http://code.google.com/p/google-gson/issues/detail?id=269
for updates on this topic.

Thanks
Inder
Reply all
Reply to author
Forward
Message has been deleted
0 new messages