I use a JSON library called JSONObject (I don\'t mind switching if I need to).
JSONObject
I know how to iterate over JSONArrays, but when I parse JSO
JSONArrays
With Java 8 and lambda, cleaner:
JSONObject jObject = new JSONObject(contents.trim()); jObject.keys().forEachRemaining(k -> { });
https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html#forEachRemaining-java.util.function.Consumer-