Does anyone knows a java library that could easily encode java Maps into json objects and the other way around?
UPDATE
For reasons couldn\'
I guess the real question would be which JSON library (from org.json's page) would NOT allow doing this. As far as I know every single library there would allow this in some form. So every library mentioned so far works.
And to add some information, Jackson works very well with all kinds of data including basic Maps and Lists:
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValue(list);
List listOfMaps = mapper.readValue(json, List.class);
which would handle this particular case. While generic type information can be used, it is optional when using "natural" binding to JDK container types.