-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