Hi,
I'm writing a JSON serialization/deserialization mechanism and I'm looking for advices :)
Currently, to use it, you do something like :
public interface PersonMapper extends ObjectMapper<Person> {}
PersonMapper mapper = GWT.create(PersonMapper.class);
And the library is generating the implementation.
I have abstract JsonSerializer and JsonDeserializer classes with default implementation for base type like String, Integer, List. The rest is considered as a POJO and the generator creates the implementation.
It works great but it's not possible to define custom serializer. For example, if a user wants to serialize a Guava collection, the generator don't know the type, will consider it as a POJO and probably fail.
I want to be able to define custom JsonSerializer and that the generator uses it instead of treating the type as a POJO.
What would be the best way to achieve this ?
Should I scan all the packages/classes in the oracle looking for JsonSerializer implementation ? Or a specific annotation maybe ?
Thanks
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment