I need to parse an input for each value. Input size is not static
{"ruleId": 1000000, "Group": "foo", "Formula": {"Aggregate": "foo", "fields":
["foo", "foo"], "Children":
{"child":
[]
} } }
Where each child can contain a list of Formulas, and each Formula can have a Children
What would be the best way to parse though this so that I can get every value and dig recursively into ‘child’ when needed?
Split, Regex, Tokenizer?
Don’t parse it yourself use existing libraries like:
Google Gson: http://code.google.com/p/google-gson/
you can read more about different json parsers for java here:
https://stackoverflow.com/questions/338586/a-better-java-json-library