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树结构
最新推荐文章于 2024-01-03 17:46:46 发布