public class JSONPrettyConverter extends JSONConverter
Representation object and a pretty-printed JSON structure.
Note that the order of attributes in a JSON Object is meaningless.
However, this Converter guarantees a consistent order between calls,
making the Representation -> String relation left-unique (i.e. a well-defined mapping).
This allows this Converter to be used for, e.g,. HashRepresentationIntoStructure,
and similar tasks that require a unique and consistent output.
BIG_INTEGER_PREFIX, BYTE_ARRAY_PREFIX, MAP_OBJ_TYPE, OBJ_OBJ_TYPE, OBJ_TYPE_KEY, REPR_OBJ_TYPE, STRING_PREFIX| Constructor and Description |
|---|
JSONPrettyConverter() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
prettyPrintJson(java.lang.String json)
Creates a nicely formatted string from the given JSON string.
|
java.lang.String |
serialize(Representation r)
Serializes the given representation to the type supported by this converter.
|
deserialize, internalDeserialize, internalSerializepublic java.lang.String serialize(Representation r)
Converterserialize in class JSONConverterr - the representation to serializepublic java.lang.String prettyPrintJson(java.lang.String json)
json - the json to pretty-print