Jersey JSONConfiguration FEATURE_POJO_MAPPING - how to skip unwanted entries during deserialization
I'm defining pojos for facebook objects, which can be consumed by clients who dont have the capacity to parse JSON. Some of the FB object's data structure is loosely defined, like work
"work":[
{"employer":{"id":"xxxxxxxxx","name":"ABC"},
"locatio开发者_StackOverflown":{"id":"xxxxxxxxx","name":"Philadelphia, Pennsylvania"}
"position":{"id":"198376496853401","name":"Manager"}
"with":[{"id":"xxxxxxxxxxxx","name":"Dogbert Smith"}]}
]
My question is how to skip these objects while deserializing. I'm using
ClientConfig config = new DefaultClientConfig(); config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
Is there a way I can customize what to deserialize?
Thanks for any pointers.
I found the solution. Added @JsonIgnoreProperties
to the pojo for which I need to ignore some properties. Works great.
精彩评论