|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectargo.format.PrettyJsonFormatter
public final class PrettyJsonFormatter
JsonFormat that formats JSON in a human-readable form. Instances of this class can safely be shared between threads.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface argo.format.JsonFormatter |
|---|
JsonFormatter.FieldSorter |
| Field Summary |
|---|
| Fields inherited from interface argo.format.JsonFormatter |
|---|
ALPHABETIC_FIELD_SORTER, DO_NOTHING_FIELD_SORTER, JSON_FIELD_COMPARATOR |
| Constructor Summary | |
|---|---|
PrettyJsonFormatter()
Constructs a JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in the order they were defined. |
|
| Method Summary | |
|---|---|
static PrettyJsonFormatter |
fieldOrderNormalisingPrettyJsonFormatter()
Gets a JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in alphabetic order. |
static PrettyJsonFormatter |
fieldOrderPreservingPrettyJsonFormatter()
Gets a JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in the order they were defined. |
java.lang.String |
format(JsonRootNode jsonNode)
Returns the specified JsonRootNode formatted as a String. |
void |
format(JsonRootNode jsonNode,
java.io.Writer writer)
Streams the specified JsonRootNode formatted to the specified Writer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PrettyJsonFormatter()
JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in the order they were defined.
| Method Detail |
|---|
public static PrettyJsonFormatter fieldOrderPreservingPrettyJsonFormatter()
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()
JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in alphabetic order.
JsonFormatter that formats JSON in a human-readable form, outputting the fields of objects in alphabetic order.public java.lang.String format(JsonRootNode jsonNode)
JsonFormatterJsonRootNode formatted as a String.
format in interface JsonFormatterjsonNode - the JsonRootNode to format.
JsonRootNode formatted as a String.
public void format(JsonRootNode jsonNode,
java.io.Writer writer)
throws java.io.IOException
JsonFormatterJsonRootNode formatted to the specified Writer.
format in interface JsonFormatterjsonNode - the JsonRootNode to format.writer - the Writer to stream the formatted JsonRootNode to.
java.io.IOException - if there was a problem writing to the Writer.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||