這是我的json需要轉換爲Java對象。 我已經嘗試了很多方法,但沒有得到成功,所以如果任何人都可以提供這方面的建議是最受歡迎的!複雜的json使用gson對java對象進行轉換
{
"id":"100006077890894",
"posts":{
"data":[
{
"message":"this is my 4th post to test...((((((((((((((((",
"from":{
"name":"Sagar Zope",
"id":"100006077890894"
},
"id":"100006077890894_1384558691756714",
"created_time":"2013-06-12T07:02:52+0000",
"comments":{
"data":[
{
"from":{
"name":"Sagar Zope",
"id":"100006077890894"
},
"message":"4th post 1st comment ..............",
"id":"1384558691756714_10803"
},
{
"from":{
"name":"Sagar Zope",
"id":"100006077890894"
},
"message":"4th post 2nd comment ..............",
"id":"1384558691756714_10804"
},
{
"from":{
"name":"Sagar Zope",
"id":"100006077890894"
},
"message":"4th post 3rd comment ..............",
"id":"1384558691756714_10805"
},
{
"from":{
"name":"Sagar Zope",
"id":"100006077890894"
},
"message":"4th post 4th comment ..............",
"id":"1384558691756714_10806"
}
]
}
},
{
"message":"this is the 3rd post .....................:)))))))",
"from":{
"name":"Sagar Zope",
"id":"100006077890894"
},
"id":"100006077890894_1384557311756852",
"created_time":"2013-06-12T07:01:24+0000",
"comments":{
"data":[
{
"from":{
"name":"Sagar Zope",
"id":"100006077890894"
},
"message":"3rd post 1st comment ..............",
"id":"1384557311756852_10797"
},
{
"from":{
"name":"Sagar Zope",
"id":"100006077890894"
},
"message":"3rd post 2nd comment ..............",
"id":"1384557311756852_10800"
},
{
"from":{
"name":"Sagar Zope",
"id":"100006077890894"
},
"message":"3rd post 3rd comment ..............",
"id":"1384557311756852_10801"
},
{
"from":{
"name":"Sagar Zope",
"id":"100006077890894"
},
"message":"3rd post 4th comment ..............",
"id":"1384557311756852_10802"
}
]
}
}
]
}
}
你需要JSON中的所有數據,還是隻需要一個片段? – MikO
顯示你已經嘗試..並要求特別的問題,你失敗的地方。 – Nishant
我需要所有的帖子和評論 –