开发者

Get selected fields from Java POJO during serialisation and deserialisation

Suppose I am having POJO which contains 10 fields and getter/setter for each one. I wou开发者_开发百科ld like to get the selected fields from that POJO during serialization and deserialization depending on some conditions. Can i achieve this using Jackson?? If so then can some on help me out and give some idea?


For serialization, you could read "Filtering properties with Jackson" for some possibilities.

As to deserialization, one possibility would be to first bind to a Map or JsonNode, then pick properties from there -- filtering options do not work deserialization.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜