- java.lang.Object
-
- at.syntaxerror.json5.JSONOptions.JSONOptionsBuilder
-
- Enclosing class:
- JSONOptions
public static class JSONOptions.JSONOptionsBuilder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JSONOptions.JSONOptionsBuilderallowInfinity(boolean allowInfinity)Whether or notInfinityshould be allowed as a number.JSONOptions.JSONOptionsBuilderallowInvalidSurrogates(boolean allowInvalidSurrogates)Whether or not invalid unicode surrogate pairs should be allowedJSONOptions.JSONOptionsBuilderallowNaN(boolean allowNaN)Whether or notNaNshould be allowed as a numberJSONOptionsbuild()JSONOptions.JSONOptionsBuilderparseInstants(boolean parseInstants)Whether or not instants should be parsed as such.JSONOptions.JSONOptionsBuilderparseStringInstants(boolean parseStringInstants)Whether or not string instants (according to RFC 3339, Section 5.6) should be parsed as such.JSONOptions.JSONOptionsBuilderparseUnixInstants(boolean parseUnixInstants)Whether or not unix instants (integers) should be parsed as such.JSONOptions.JSONOptionsBuilderquoteSingle(boolean quoteSingle)Whether or not string should be single-quoted (') instead of double-quoted (").JSONOptions.JSONOptionsBuilderstringifyUnixInstants(boolean stringifyUnixInstants)Whether or not instants should be stringifyed as unix timestamps.java.lang.StringtoString()
-
-
-
Method Detail
-
parseInstants
public JSONOptions.JSONOptionsBuilder parseInstants(boolean parseInstants)
Whether or not instants should be parsed as such. If this isfalse,JSONOptions.isParseStringInstants()andJSONOptions.isParseUnixInstants()are ignoredDefault:
trueThis is a
Parser-only option- Parameters:
parseInstants- a boolean- Returns:
this.- Since:
- 1.1.0
-
parseStringInstants
public JSONOptions.JSONOptionsBuilder parseStringInstants(boolean parseStringInstants)
Whether or not string instants (according to RFC 3339, Section 5.6) should be parsed as such. Ignored ifJSONOptions.isParseInstants()isfalseDefault:
trueThis is a
Parser-only option- Parameters:
parseStringInstants- a boolean- Returns:
this.- Since:
- 1.1.0
-
parseUnixInstants
public JSONOptions.JSONOptionsBuilder parseUnixInstants(boolean parseUnixInstants)
Whether or not unix instants (integers) should be parsed as such. Ignored ifJSONOptions.isParseInstants()isfalseDefault:
trueThis is a
Parser-only option- Parameters:
parseUnixInstants- a boolean- Returns:
this.- Since:
- 1.1.0
-
stringifyUnixInstants
public JSONOptions.JSONOptionsBuilder stringifyUnixInstants(boolean stringifyUnixInstants)
Whether or not instants should be stringifyed as unix timestamps. If this isfalse, instants will be stringifyed as strings (according to RFC 3339, Section 5.6).Default:
falseThis is a
Stringify-only option- Parameters:
stringifyUnixInstants- a boolean- Returns:
this.- Since:
- 1.1.0
-
allowNaN
public JSONOptions.JSONOptionsBuilder allowNaN(boolean allowNaN)
Whether or notNaNshould be allowed as a numberDefault:
true- Parameters:
allowNaN- a boolean- Returns:
this.- Since:
- 1.1.0
-
allowInfinity
public JSONOptions.JSONOptionsBuilder allowInfinity(boolean allowInfinity)
Whether or notInfinityshould be allowed as a number. This applies to both+Infinityand-InfinityDefault:
true- Parameters:
allowInfinity- a boolean- Returns:
this.- Since:
- 1.1.0
-
allowInvalidSurrogates
public JSONOptions.JSONOptionsBuilder allowInvalidSurrogates(boolean allowInvalidSurrogates)
Whether or not invalid unicode surrogate pairs should be allowedDefault:
trueThis is a
Parser-only option- Parameters:
allowInvalidSurrogates- a boolean- Returns:
this.- Since:
- 1.1.0
-
quoteSingle
public JSONOptions.JSONOptionsBuilder quoteSingle(boolean quoteSingle)
Whether or not string should be single-quoted (') instead of double-quoted ("). This also includes aJSONObject'smember namesDefault:
falseThis is a
Stringify-only option- Parameters:
quoteSingle- a boolean- Returns:
this.- Since:
- 1.1.0
-
build
public JSONOptions build()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-