开发者

How to serialize/deserialize third party Java objects with Jackson

开发者 https://www.devze.com 2023-03-30 03:01 出处:网络
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

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

精彩评论

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

关注公众号