Package jodd.json
Class PrettyJsonSerializer
- java.lang.Object
-
- jodd.json.JsonSerializer
-
- jodd.json.PrettyJsonSerializer
-
public class PrettyJsonSerializer extends JsonSerializer
JsonSerializerthat prints out formatted JSON. It is slower, but the output is prettier.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jodd.json.JsonSerializer
JsonSerializer.Defaults
-
-
Field Summary
Fields Modifier and Type Field Description private booleanbreakOnNewObjectprivate intdeepprivate charidentCharprivate intidentSizeprivate booleanprefixSeparatorBySpaceprivate booleansuffixSeparatorBySpace-
Fields inherited from class jodd.json.JsonSerializer
classMetadataName, excludedTypeNames, excludedTypes, excludeEmpty, excludeNulls, pathSerializersMap, rules, serializerResolver, strictStringEncoding, typeSerializersMap
-
-
Constructor Summary
Constructors Constructor Description PrettyJsonSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidbreakLine(JsonContext jsonContext)JsonContextcreateJsonContext(java.lang.Appendable appendable)Creates new JSON context.private voidident(JsonContext jsonContext)voididentChar(char identChar)Sets ident character.voididentSize(int ident)Defines ident size in number ofidentCharto be used for single indentation.-
Methods inherited from class jodd.json.JsonSerializer
create, createPrettyOne, deep, exclude, exclude, exclude, excludeEmpty, excludeNulls, excludeTypes, excludeTypes, include, include, onValue, serialize, serialize, setClassMetadataName, strictStringEncoding, withClassMetadata, withSerializer, withSerializer
-
-
-
-
Method Detail
-
identSize
public void identSize(int ident)
Defines ident size in number ofidentCharto be used for single indentation.
-
identChar
public void identChar(char identChar)
Sets ident character. Usually its a space or a tab.
-
breakLine
private void breakLine(JsonContext jsonContext)
-
ident
private void ident(JsonContext jsonContext)
-
createJsonContext
public JsonContext createJsonContext(java.lang.Appendable appendable)
Description copied from class:JsonSerializerCreates new JSON context.- Overrides:
createJsonContextin classJsonSerializer
-
-