public static class JsonGrammar.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
JsonGrammar.Builder |
bareRootObject(boolean bare)
When printing out a root object, omit the opening and closing braces ( "{}" )
|
JsonGrammar.Builder |
bareSpecialNumerics(boolean bare)
When printing output, print numeric values like NaN and Infinity without quotes.
|
JsonGrammar |
build()
Finalizes this JsonGrammar and returns it.
|
JsonGrammar.Builder |
printCommas(boolean commas)
Indicates whether commas should be output to make the result more readable.
|
JsonGrammar.Builder |
printTrailingCommas(boolean trailing)
If true, JSON5 trailing commas will be printed in all objects and lists.
|
JsonGrammar.Builder |
printUnquotedKeys(boolean unquoted) |
JsonGrammar.Builder |
printWhitespace(boolean whitespace)
Indicates whether additional tabs and newlines should be printed to make json more
readable for humans.
|
JsonGrammar.Builder |
withComments(boolean comments)
Indicates that comments should be accepted as input, and preserved in output.
|
public JsonGrammar.Builder withComments(boolean comments)
public JsonGrammar.Builder printWhitespace(boolean whitespace)
public JsonGrammar.Builder printCommas(boolean commas)
public JsonGrammar.Builder printTrailingCommas(boolean trailing)
printCommas(boolean) is false. Defaults
to false.public JsonGrammar.Builder bareSpecialNumerics(boolean bare)
public JsonGrammar.Builder bareRootObject(boolean bare)
public JsonGrammar.Builder printUnquotedKeys(boolean unquoted)
public JsonGrammar build()