我有一个特定的 JSON 节点,它对应于 import org.codehaus.jackson.JsonNode,而不是 import org.codehaus.jackson.map.JsonNode。
[
{
"givenName": "Jim",
"formattedName": "jimJackson",
"familyName": null,
"middleName": "none",
"honorificPrefix": "mr",
"honorificSuffix": "none"
},
{
"givenName": "john",
"formattedName": "johnLasher",
"familyName": null,
"middleName": "none",
"honorificPrefix": "mr",
"honorificSuffix": "none"
},
{
"givenName": "carlos",
"formattedName": "carlosAddner",
"familyName": null,
"middleName": "none",
"honorifiPrefix": "mr",
"honorificSuffix": "none"
},
{
"givenName": "lisa",
"formattedName": "lisaRay",
"familyName": null,
"middleName": "none",
"honorificPrefix": "mrs",
"honorificSuffix": "none"
},
{
"givenName": "bradshaw",
"formattedName": "bradshawLion",
"familyName": null,
"middleName": "none",
"honorificPrefix": "mr",
"honorificSuffix": "none"
},
{
"givenName": "phill",
"formattedName": "phillKane",
"familyName": null,
"middleName": "none",
"honorificPrefix": "mr",
"honorificSuffix": "none"
},
{
"givenName": "Gabriel",
"formattedName": "gabrielMoosa",
"familyName": null,
"middleName": "none",
"honorificPrefix": "mr",
"honorificSuffix": "none"
}
]
我想从上述数组的所有 JSON 节点中删除“familyName”和“middleName”。有什么办法可以做到这一点?