// 将json字符串转换为json对象 JSONObject jsonObject = JSON.parseObject(jsonStr); // {"retState":"SUCCESS","retCode":"000000","retMsg":"成功", "data":[{"id":2150,"name":"合肥市","address":null}],"total":0} // json字符串转java对象 String data = jsonObject.getString("data"); ComboxResponse city = JSON.parseObject(data, List<ComboxResponse>.class); // json字符串转List集合 ComboxResponse city = JSON.parseArray(data, ComboxResponse.class).get(0);
原文地址:https://www.cnblogs.com/smileblogs/p/9594577.html
时间: 2024-10-11 11:47:06