1.string转json
String params={'key1':'50001','key2':10007700'}
Map<String, String> a = JSON.parseObject(params,new TypeReference<Map<String,String>>(){});
2.string转object
String params={'key1':'50001','key2':10007700'}
CommonParam commonParam =json.parseObject(params[0], CommonParam.class);
3.[{},{}]转化为List<StoreAddParam> storeAddParamList
JSON.parseObject(string,new TypeReference<List<StoreAddParam>>(){});
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
public static final JSONArray parseArray(String text); // 把JSON文本parse成JSONArray
public static final <T> List<T> parseArray(String text, Class<T> clazz); //把JSON文本parse成JavaBean集合
public static final String toJSONString(Object object); // 将JavaBean序列化为JSON文本
public static final String toJSONString(Object object, boolean prettyFormat); // 将JavaBean序列化为带格式的JSON文本
public static final Object toJSON(Object javaObject); 将JavaBean转换为JSONObject或者JSONArray。