RawSushi's Tech Journal
My online tech scrapbook where I keep my notes in case I need to look them up later
Friday, June 1, 2012
Field Exclusion with GSON
Easiest way to do it is to actually use annotations to mark fields to include.
To use this, just create Gson object this way:
new GsonBuilder().excludeFieldsWithoutExpose
Annotation().create()
And then annotate every field you want to expose with the @Expose annotation.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment