Package blue.endless.jankson
Class JsonGrammar
java.lang.Object
blue.endless.jankson.JsonGrammar
Represents a style of json written out, and a set of quirks to parse going in.
Typically you'll want to use a different grammar in than out.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanstatic final JsonGrammarA grammar which will print compactified JSON readable by almost all vanilla json parsers.static final JsonGrammarA grammar which will accept all supported quirks, and output JSON-with-comments, which is a valid jankson subset.static final JsonGrammarA grammar which will accept JSON5 and output JSON-with-comments with trailing commas.protected booleanprotected booleanprotected booleanprotected booleanstatic final JsonGrammarA grammar which will only accept or output strict JSON. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
JANKSON
A grammar which will accept all supported quirks, and output JSON-with-comments, which is a valid jankson subset. This is the default behavior. -
JSON5
A grammar which will accept JSON5 and output JSON-with-comments with trailing commas. -
STRICT
A grammar which will only accept or output strict JSON. -
COMPACT
A grammar which will print compactified JSON readable by almost all vanilla json parsers. (Note: Jackson may read special numerics like NaN in as Strings) -
comments
protected boolean comments -
printWhitespace
protected boolean printWhitespace -
printCommas
protected boolean printCommas -
printTrailingCommas
protected boolean printTrailingCommas -
bareSpecialNumerics
protected boolean bareSpecialNumerics -
bareRootObject
protected boolean bareRootObject -
printUnquotedKeys
protected boolean printUnquotedKeys
-
-
Constructor Details
-
JsonGrammar
public JsonGrammar()
-
-
Method Details
-
hasComments
public boolean hasComments() -
shouldOutputWhitespace
public boolean shouldOutputWhitespace() -
builder
-