正如您所看到的,由下面的字符串映射的數組包含JSON對象,其屬性的值可能是JSON對象的數組。
什麼是簡單的方法來解析這個JSON對象數組(對於層次結構中的所有元素)?將字符串遞歸解析爲JSON
[{"address_components":
[{"long_name":"China","short_name":"CN","types" ["country","political"]}],
"formatted_address":"Volksrepublik China",
"geometry":{
"bounds":{
"$":{"b":18.1535216,"d":53.56097399999999},
"fa":{"b":73.49941360000003,"d":134.77280989999997}
},
"location": {"jb":35.86166,"kb":104.19539699999996},
"location_type":"APPROXIMATE",
"viewport":{
"$":{"b":18.1535216,"d":53.56097399999999},
"fa":{"b":73.49941360000003,"d":134.77280989999997}
}
},
"types":["country","political"]
}]
只是反序列化它。無論您使用哪種語言....? – GolezTrol
你想用什麼來解析它? JS,.NET,Phyton ... – OzrenTkalcecKrznaric
oops,我想使用Java。 – Lester