-1
我需要通过递归解析此JSON ..递归JSON解析器
{
"code": "200",
"data": [
{
"id": "2",
"name": "BE",
"parent": "0",
"children": [
{
"id": "3",
"name": "Computer Science",
"parent": "2",
"children": [
{
"id": "4",
"name": "1st Year",
"parent": "3",
"children": [
{
"id": "8",
"name": "A",
"parent": "4",
"children": []
},
{
"id": "9",
"name": "B",
"parent": "4",
"children": []
}
]
},
{
"id": "5",
"name": "2nd Year",
"parent": "3",
"children": [
{
"id": "10",
"name": "A",
"parent": "5",
"children": []
},
{
"id": "11",
"name": "B",
"parent": "5",
"children": []
}
]
},
{
"id": "6",
"name": "3rd Year",
"parent": "3",
"children": [
{
"id": "12",
"name": "A",
"parent": "6",
"children": []
},
{
"id": "13",
"name": "B",
"parent": "6",
"children": []
}
]
},
{
"id": "7",
"name": "4th Year",
"parent": "3",
"children": [
{
"id": "14",
"name": "A",
"parent": "7",
"children": []
},
{
"id": "15",
"name": "B",
"parent": "7",
"children": []
}
]
}
]
}
]
},
{
"id": "16",
"name": "ME",
"parent": "0",
"children": []
},
{
"id": "17",
"name": "Btech",
"parent": "0",
"children": []
}
]
}
你是什么想要吗? –
我需要解析这个,并想设置为spinners ..在选择BE/ME/Btech之后,我需要获得孩子数据[计算机科学在第二次微调]后,再次选择计算机科学需要像第一年或第二年在单独的微调器 – sree
所有的JSON解析器将递归解析通过树。只需根据选定的键浏览java.util.Map。 – Gautam