String aa="[{\"id\":\"0\",\"name\":\"退役后\"}]";
try{
JSONArray json=JSONArray.fromObject(aa);
for (int i = 0; i < json.size(); i++) {
JSONObject jb=json.getJSONObject(i);
try{
String DM_OBJECTNAME=jb.getString("DM_LEASTVALUE");
String EQU="["+jb.getString("EQU")+"]";
System.out.println(DM_OBJECTNAME);
JSONArray equ=JSONArray.fromObject(EQU);
for (int j = 0; j < equ.size(); j++) {
JSONObject equo=equ.getJSONObject(j);
try{
String EQU_NAME=equo.getString("EQU_NAME");
System.out.println(EQU_NAME);
}catch(NullPointerException e){
System.out.println("判断json中的数据不能为null"+e);
}
}
}catch(NullPointerException e){
System.out.println("判断json中的数据不能为null"+e);
}
}
}catch(JSONException e){
System.out.println("判断json不能为null"+e);
}
try{
JSONArray json=JSONArray.fromObject(aa);
for (int i = 0; i < json.size(); i++) {
JSONObject jb=json.getJSONObject(i);
try{
String DM_OBJECTNAME=jb.getString("DM_LEASTVALUE");
String EQU="["+jb.getString("EQU")+"]";
System.out.println(DM_OBJECTNAME);
JSONArray equ=JSONArray.fromObject(EQU);
for (int j = 0; j < equ.size(); j++) {
JSONObject equo=equ.getJSONObject(j);
try{
String EQU_NAME=equo.getString("EQU_NAME");
System.out.println(EQU_NAME);
}catch(NullPointerException e){
System.out.println("判断json中的数据不能为null"+e);
}
}
}catch(NullPointerException e){
System.out.println("判断json中的数据不能为null"+e);
}
}
}catch(JSONException e){
System.out.println("判断json不能为null"+e);
}