I would like to parse some JSON string the represents either an array or a map in the simplest possible way. I have the whole JSON string, no streaming is needed.
What I would like to do is something as similar as possible to this:
Object obj = parseJSON(theString);
Where obj would then hold an instance of either a Map or a List (I cannot know in advance which). The JSON object can be arbitrarily nested with maps and arrays but all types will be representable as basic Java types: String, Integer, Double, Boolean plus Map and ArrayList, nothing else.
All the simple examples I have found so far require me to know what the type is and which types I want, but I want to let all this do the JSON parser since I simply will not know in advance what I get.
If Jackson is not the best library to do this, what else could I use?