Jackson - suppressing serialization(write) of properties dynamically

前端 未结 4 2106
难免孤独
难免孤独 2021-01-04 10:21

I am trying to convert java object to JSON object in Tomcat/jersey using Jackson. And want to suppress serialization(write) of certain properties dynamically.

I can

4条回答
  •  生来不讨喜
    2021-01-04 11:02

    Yes, JSON View is the way to go.

    If you e.g. need to let the client to decide which fields to marshal, this example might help: http://svn.codehaus.org/jackson/tags/1.6/1.6.3/src/sample/CustomSerializationView.java

提交回复
热议问题