Closed GoogleCodeExporter closed 9 years ago
Did you follow the following example? It should work.
http://code.google.com/p/json-simple/wiki/DecodingExamples#Example_4_-_Container
_factory
Original comment by fangyid...@gmail.com
on 19 Sep 2012 at 2:20
this example returns the map object but i need the jsonObject ...
Original comment by noman.iq...@purelogics.net
on 19 Sep 2012 at 4:57
You mean instance of JSONObject? If it's the case, you can do something like:
Map jsonMap = <Map object return by JSONParaer>;
JSONObject jsonObject = new JSONObject(jsonObject);
Original comment by fangyid...@gmail.com
on 19 Sep 2012 at 9:40
JSONObject jsonObject = new JSONObject(jsonObject);
this line will change the order of keys...
that's y i want to use this simple class
Original comment by noman.iq...@purelogics.net
on 19 Sep 2012 at 9:41
Well, JSONObject is also a Map. May I ask why you need a JSONObject instead of
a Map? I mean, if you just want to manipulate it and encode it to JSON string
later, you can use JSONValue to encode the Map object directly:
http://code.google.com/p/json-simple/wiki/EncodingExamples#Example_1-3_-_Encode_
a_JSON_object_-_Using_Map
Original comment by fangyid...@gmail.com
on 19 Sep 2012 at 3:46
Original comment by fangyid...@gmail.com
on 21 Sep 2012 at 3:20
Original issue reported on code.google.com by
noman.iq...@purelogics.net
on 18 Sep 2012 at 12:24