Reputation: 326
I know a JSON that maintains order is no longer JSON, but this is a requirement in some use and throw code. I have read other hacks like replacing HashMap with LinkedHashMap in the JSONObject.java file. I was wondering if there is a parser which does this without any modifications.
Upvotes: 0
Views: 58
Reputation: 36987
You could use a streaming JSON parser, e.g. Jackson, which will deliver the tags as it finds it. Of course that means that you might have to change your program logic to process the JSON elements on the fly.
Upvotes: 1