How to convert all the value to uppercase when using ObjectMapper to serialize Java POJO to JSON?

3,055 views
Skip to first unread message

Eric Chow

unread,
Apr 10, 2014, 9:39:43 PM4/10/14
to jackso...@googlegroups.com
Hello,

Is it possible to  convert all the value to uppercase when using ObjectMapper to serialize Java POJO to JSON?

Any example, please?


Best regards,
Eric




Tatu Saloranta

unread,
Apr 10, 2014, 10:46:35 PM4/10/14
to jackso...@googlegroups.com
No; your best bet would be to either write custom JsonSerializer for String type; or to serialize as tree (JsonNode), then traverse and recursively upper case all String nodes.

-+ Tatu +-



--
You received this message because you are subscribed to the Google Groups "jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user...@googlegroups.com.
To post to this group, send email to jackso...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages