Jackson JSON Deserialization: array elements in each line
问题 I am using Jackson and would like to pretty-print JSON such that each element in arrays goes to each line, like: { "foo" : "bar", "blah" : [ 1, 2, 3 ] } Setting SerializationFeature.INDENT_OUTPUT true only inserts newline characters for object fields, not array elements, printing the object in this way instead: { "foo" : "bar", "blah" : [1, 2, 3] } Does anyone know how to achieve this? Thanks! 回答1: You could extend the DefaultPrettyPrinter and override the methods beforeArrayValues(…) and