admin管理员组文章数量:1122832
I have a rather complicated Class structure that is needed to be serialized into CBOR. Now issue is that sometimes I need CBOR with tags while other times I need without tags.
I'd like to be able to define the serializers only once and then have some sort of a toggle flag to tell the serialize if it should include tags or not.
I have
private static final ObjectMapper CBOR_MAPPER = new ObjectMapper(new CBORFactory());
And it is used like this
CBOR_MAPPER.writeValueAsBytes(object)
Is there a way to somehow add additional options for specific serialization calls?
本文标签: javaCustom serializer for Jackson with toggleable optionsStack Overflow
版权声明:本文标题:java - Custom serializer for Jackson with toggleable options - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736311422a1934731.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论