public void listest(@RequestBody String strjson) { List<String> ds =new ArrayList<String>(); JSONObject json = JSONObject.parseObject(strjson); for (Map.Entry<String, Object> firstEntry : json.entrySet()) { String firstValue=firstEntry.getValue().toString(); if(firstValue.isEmpty()){ continue; } int i = jsonParseServices.testIsObject(firstValue); if (i==1){ System.out.println("+++++++++++++++++++++++++++++"+firstEntry.getKey()+"+++++++++++++++++++++++++++++++++++++"); listest(firstValue); } else { System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>"+firstEntry.getKey().toString()+"::::"+firstValue+"<<<<<<<<<<<<<<<<<<<<<<<<"); } } }
在Java中遍历json树结构
最新推荐文章于 2023-02-28 12:40:09 发布