In the actual version of the google-gson developers are able to create a
customized strategy to field exclusion and this is great, I was able to create
a strategy that I think to be smarter than the original one.
My strategy doesn't just allow me to exclude fields by their name because
sometimes the name repeats itself across a lot of classes (most common in JPA
entities) but it also allows me to specify the class in which the field that I
want to exclude lives. This is working great because it used to generate lots
of circular references and I was compelled to exclude the fields that generates
that circular references, but how that name is common across some entities I
had seen myself in trouble using the default behavior that excludes every field
in the object graph with that specified name.
Therefore, I think it would be great to enable this kind of feature either
native in the GsonBuilder or by enabling customizing include strategy as today
exists for excluding. What you guys think about this?
Thanks.
Original issue reported on code.google.com by Jayrmo...@gmail.com on 30 Dec 2011 at 12:44
Original issue reported on code.google.com by
Jayrmo...@gmail.com
on 30 Dec 2011 at 12:44