I try to parse a simple json dictionary, so I read many tutorials and threads on how to achieve this
but there is no "keys()" nor "keySet()" defined for JSONObject nor JSONArray
I downloaded the library here :
http://www.java2s.com/Code/Jar/j/Downloadjsonsimple111jar.htm
I am starting to wonder if I use the right library
here is my code :
import org.json.simple.parser.ParseException;
import org.json.simple.parser.JSONParser;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
JSONParser parser = new JSONParser();
JSONObject obj = (JSONObject)parser.parse(json.trim());
Iterator keys = obj.keys(); <<<<<<<<<<<<<<<<<<<<<<<<<<<< keys() undefined
while(keys.hasNext()) {
String key = keys.next();
}
json example :
{a:132,b:"1321",test:"something"}
any help appreciated
thanks