Class PrettyPrint
java.lang.Object
com.espertech.esper.common.client.json.minimaljson.WriterConfig
com.espertech.esper.common.client.json.minimaljson.PrettyPrint
Enables human readable JSON output by inserting whitespace between values.after commas and
colons. Example:
jsonValue.writeTo(writer, PrettyPrint.singleLine());
-
Field Summary
Fields inherited from class com.espertech.esper.common.client.json.minimaljson.WriterConfig
MINIMAL, PRETTY_PRINT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateWriter
(Writer writer) static PrettyPrint
indentWithSpaces
(int number) Print every value on a separate line.static PrettyPrint
Do not break lines, but still insert whitespace between values.static PrettyPrint
Print every value on a separate line.
-
Constructor Details
-
PrettyPrint
protected PrettyPrint(char[] indentChars)
-
-
Method Details
-
singleLine
Print every value on a separate line. Use tabs (\t
) for indentation.- Returns:
- A PrettyPrint instance for wrapped mode with tab indentation
-
indentWithSpaces
Print every value on a separate line. Use the given number of spaces for indentation.- Parameters:
number
- the number of spaces to use- Returns:
- A PrettyPrint instance for wrapped mode with spaces indentation
-
indentWithTabs
Do not break lines, but still insert whitespace between values.- Returns:
- A PrettyPrint instance for single-line mode
-
createWriter
- Specified by:
createWriter
in classWriterConfig
-