Open GoogleCodeExporter opened 9 years ago
Issue 307 has been merged into this issue.
Original comment by joel.leitch@gmail.com
on 13 Apr 2011 at 7:30
Very clever workaround...hats off to you for thinking about it this way.
I believe this is a valid and useful feature request so I will look into
getting this into the next release of Gson.
Side note:
Your above implementation is not Thread-safe.
Original comment by joel.leitch@gmail.com
on 13 Apr 2011 at 7:34
Yes, this workaround is not thread-safe, so I encapsulated the Gson instance
within ThreadLocal to keep it safe for concurrency.
BTW, this workaround also rely on another internal assumption that
shouldSkipField() was called before each serialize() call. But in my opinion,
this assumption could become false if shouldSkipField() method is optimized to
be called only once per field, but not per field of each instance.
Original comment by oasisfeng
on 17 Apr 2011 at 4:34
hi! I would like to second the request for enhancement. I've got a very similar
use case where I would like to alter serialization / deserialization based on a
filed's annotation.
Original comment by pkozlows...@gmail.com
on 19 Dec 2011 at 8:09
Can you use two different Gson instances, each of which has its own
ExclusionStrategy?
Original comment by limpbizkit
on 18 Mar 2012 at 8:22
Is there any update? Will this be ever implemented?
Original comment by armond...@gmail.com
on 7 May 2013 at 10:04
Original issue reported on code.google.com by
oasisfeng
on 1 Apr 2011 at 1:34