1.没有key
json:
{
"person":[
{
"name" : "hello",
"childs" : ["few", "gr3"]
},
{
"name" : "world",
"childs" : ["h4w", "ku6r"]
}
]
}
jsonBean:
public class JsonBean {
public ArrayList<Person> person;
public static class Person{
String name;
ArrayList<String> childs;
}
}
2.不确定key
json:
{
"person":[
{
"name" : "hello",
"childs" : [{"1":"few"}, {"2":"akuy"}]
},
{
"name" : "world",
"childs" : [{"8":"ngf"}, {"9":"y54"}]
}
]
}
jsonbean:
public class JsonBean {
public ArrayList<Person> person;
public static class Person{
String name;
ArrayList<Map<String,String>> childs;
}
}
网友评论