我有一个 JSONString :
<i>{1={"id":"1","description":"Red","Objects":{"doors":4,"number":4},"life":100}}</i>
如何将此JSONString放入带有JSONSimple
的哈希映射?
答案 0 :(得分:0)
此代码用于JSON-simple的wiki页面http://code.google.com/p/json-simple/wiki/DecodingExamples#Example_1_-_Convenient_way:_Use_JSONValue
String s="[{1={"id":"1","description":"Red","Objects": {"doors":4,"number":4},"life":100}}]";
Object obj=JSONValue.parse(s);
JSONArray array=(JSONArray)obj;