guochaiqi / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Few serialization strategies for same type #148

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I want to be able to serialize same object to different Json representations. 
Example:

public class Some {
private String field;
private String filed2;
private String filed3;
}

I want to have a way to get JSON with field and field2, but also I want to 
create JSON with field and field3. 
I think, annotation @Mode({string}) could help.

Original issue reported on code.google.com by yura.ta...@gmail.com on 20 Aug 2009 at 2:52

GoogleCodeExporter commented 9 years ago
Can you write a custom serializer that does what you want? 

Original comment by inder123 on 1 Sep 2009 at 9:59

GoogleCodeExporter commented 9 years ago
I am not sure how the @Mode annotation is supposed to work besides you can do 
the same with a custom 
serializer. I am closing this bug but feel free to reopen it with more details 
and compelling example use-cases. 

Original comment by inder123 on 23 Sep 2009 at 5:26