java - Modifying all the string primitives in a JSON structure -
in java, given textual representation of json object, how can apply function leaves strings?
for example, converting string values upper case:
input:
{ "name": "john", "address": { "street": "elm", "number": 4 }, "children": ["george", "paul"] }
output:
{ "name": "john", "address": { "street": "elm" "number": 4 }, "children": ["george", "paul"] }
use gson (or other json parser) parse data map
, remove non strings, serialize json using gson
Comments
Post a Comment