How do I make Jackson's build() method pretty-print its JSON output? Here is an example that pretty-prints the ugly form of JSON code. I need to take the nice version of JSON code then convet it to ugly fom. How can it be done? I need to convert this:
{
"one" : "AAA",
"two" : [ "BBB", "CCC" ],
"three" : {
"four" : "DDD",
"five" : [ "EEE", "FFF" ]
}
}
to this:
{"one":"AAA","two":["BBB","CCC"],"three":{"four":"DDD","five":["EEE","FFF"]}}
I tried to remove '\n', '\t', and ' ' characters; but there may be some of these characters in values so I can't do that. What else can be done?