1. JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(map));
JSONObject json2 = (JSONObject) JSONObject.toJSON(map);
TestBean testBean = JSONObject.parseObject(JSONObject.toJSONString(map), TestBean.class);
JSONArray json = JSONObject.parseArray( ((JSONObject) JSONObject.parse(JSONObject.toJSONString(map))).getString("1"));
for (int i = 0; i < json.size(); i++) {
System.out.println(json.get(i));
}
2. testJson = eval("(" + testJson + ")");
3. 常用方法
public static final Object parse(String text); // 把 JSON 文本 parse 为 JSONObject 或者 JSONArray
public static final JSONObject parseObject(String text); // 把 JSON 文本 parse 成 JSONObject
public static final <T> T parseObject(String text, Class<T> clazz); // 把 JSON 文本 parse 为 JavaBean
JSONObject json2 = (JSONObject) JSONObject.toJSON(map);
TestBean testBean = JSONObject.parseObject(JSONObject.toJSONString(map), TestBean.class);
JSONArray json = JSONObject.parseArray( ((JSONObject) JSONObject.parse(JSONObject.toJSONString(map))).getString("1"));
for (int i = 0; i < json.size(); i++) {
System.out.println(json.get(i));
}
2. testJson = eval("(" + testJson + ")");
3. 常用方法
public static final Object parse(String text); // 把 JSON 文本 parse 为 JSONObject 或者 JSONArray
public static final JSONObject parseObject(String text); // 把 JSON 文本 parse 成 JSONObject
public static final <T> T parseObject(String text, Class<T> clazz); // 把 JSON 文本 parse 为 JavaBean