如何在 Java 中解析 JSON Google GSON (Maven) Org.JSON (Maven) 杰克逊(梅文))
我有以下 JSON 文本。如何解析它以获取 、 、 等的值?pageName
pagePic
post_id
{
"pageInfo": {
"pageName": "abc",
"pagePic": "http://example.com/content.jpg"
},
"posts": [
{
"post_id": "123456789012_123456789012",
"actor_id": "1234567890",
"picOfPersonWhoPosted": "http://example.com/photo.jpg",
"nameOfPersonWhoPosted": "Jane Doe",
"message": "Sounds cool. Can't wait to see it!",
"likesCount": "2",
"comments": [],
"timeOfPost": "1234567890"
}
]
}