/** * json字符串转list * @param jsonStr * @return */ public static List<Map<String,Object>> GetJsonListByString(String jsonStr){ List<Map<String, Object>> rsList = new ArrayList<>(); try { JSONArray arry = JSONArray.parseArray(jsonStr); for (int i = 0; i < arry.size(); i++) { JSONObject jsonObject = arry.getJSONObject(i); Set<String> stringSet = jsonObject.keySet(); Map<String, Object> map = new HashMap<>(); for (String key :stringSet){ Object value = jsonObject.get(key); map.put(key, value); } rsList.add(map); } } catch (Exception e) { e.printStackTrace(); } return rsList; }
标签:jsonStr,Map,map,json,key,字符串,arry From: https://www.cnblogs.com/ht-privete-logs/p/17174315.html