Does Jackson2 provide something similar to JAX-B&#

2019-03-02 13:05发布

问题:

I have a need in certain cases to alter the serialized/deserialized value while marshalling/unmarshalling JSON using Jackson2.

Does there exist a mechanism similar to javax.xml.bind.Unmarhsaller.Listener/javax.xml.bind.Marshaller.Listener?

回答1:

No. There have been requests for post-processing hooks, esp. for deserialization, but no implementation yet.

Jackson 2.2 will come with Converter annotation (@JsonSerialize(converter=MyConverter.class), @JsonDeserialize(converter=...)) which could perhaps be used for similar purpose. This is similar to JAXB XmlJavaAdapter.



标签: jaxb jackson