JsonGenerator.@Deprecated
public final class PrettyJsonFormatter
extends java.lang.Object
| Constructor and Description |
|---|
PrettyJsonFormatter()
Deprecated.
Replaced by
JsonGenerator.generate(JsonNode) and JsonGenerator.generate(Writer, JsonNode).
For example, use
new JsonGenerator().style(PRETTY).generate(Writer, JsonNode)
or
new JsonGenerator().style(PRETTY).generate(JsonNode) |
| Modifier and Type | Method and Description |
|---|---|
static PrettyJsonFormatter |
fieldOrderNormalisingPrettyJsonFormatter()
Deprecated.
Replaced by
JsonGenerator.generateWithFieldSorting(JsonNode) and JsonGenerator.generateWithFieldSorting(Writer, JsonNode).
For example, use
new JsonGenerator().style(PRETTY).generateWithFieldSorting(Writer, JsonNode)
or
new JsonGenerator().style(PRETTY).generateWithFieldSorting(JsonNode) |
static PrettyJsonFormatter |
fieldOrderPreservingPrettyJsonFormatter()
Deprecated.
Replaced by
JsonGenerator.generate(JsonNode) and JsonGenerator.generate(Writer, JsonNode).
For example, use
new JsonGenerator().style(PRETTY).generate(Writer, JsonNode)
or
new JsonGenerator().style(PRETTY).generate(JsonNode) |
java.lang.String |
format(JsonNode jsonNode)
Returns the specified
JsonNode formatted as a String. |
void |
format(JsonNode jsonNode,
java.io.Writer writer)
Streams the specified
JsonNode formatted to the specified Writer. |
public PrettyJsonFormatter()
JsonGenerator.generate(JsonNode) and JsonGenerator.generate(Writer, JsonNode).
For example, use
new JsonGenerator().style(PRETTY).generate(Writer, JsonNode)
or
new JsonGenerator().style(PRETTY).generate(JsonNode) JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in the order they were defined.public static PrettyJsonFormatter fieldOrderPreservingPrettyJsonFormatter()
JsonGenerator.generate(JsonNode) and JsonGenerator.generate(Writer, JsonNode).
For example, use
new JsonGenerator().style(PRETTY).generate(Writer, JsonNode)
or
new JsonGenerator().style(PRETTY).generate(JsonNode) JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in the order they were defined.JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in the order they were defined.public static PrettyJsonFormatter fieldOrderNormalisingPrettyJsonFormatter()
JsonGenerator.generateWithFieldSorting(JsonNode) and JsonGenerator.generateWithFieldSorting(Writer, JsonNode).
For example, use
new JsonGenerator().style(PRETTY).generateWithFieldSorting(Writer, JsonNode)
or
new JsonGenerator().style(PRETTY).generateWithFieldSorting(JsonNode) JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in alphabetic order.
In the event that more than one field with the same name exists in an object, the relative order of those fields is preserved.JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in alphabetic order.public final java.lang.String format(JsonNode jsonNode)
JsonFormatterJsonNode formatted as a String.format in interface JsonFormatterjsonNode - the JsonNode to format.JsonNode formatted as a String.public final void format(JsonNode jsonNode, java.io.Writer writer) throws java.io.IOException
JsonFormatterJsonNode formatted to the specified Writer.format in interface JsonFormatterjsonNode - the JsonNode to format.writer - the Writer to stream the formatted JsonNode to.java.io.IOException - if there was a problem writing to the Writer.