开发者

How to serialize/deserialize third party Java objects with Jackson

As an example, I'd like to serialize/deseriali开发者_运维百科ze one object of Slick2d's Animation class using Jackson. What is the simplest way to do this?


You can annotate a mix-in interface if you want to control the generated json on third party classes.

read more here: http://wiki.fasterxml.com/JacksonMixInAnnotations

Update: The current documentation (v2+) is here: https://github.com/FasterXML/jackson-docs/wiki/JacksonMixInAnnotations


Just as any object - pass it to objectMapper.readValue(..) / objectMapper.writeValue(..)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜