Class JSONParserErrorHandlingOptions
- java.lang.Object
- 
- com.github.tnakamot.json.parser.JSONParserErrorHandlingOptions
 
- 
 public class JSONParserErrorHandlingOptions extends Object A data structure to hold options to change the behavior of the JSON parser when it encounters a questionable JSON token and switches to change the error message formatJSONParserException. SeeJSONParserExceptionfor more details about how the error messages are formatted.Instances of this class are immutable. This class follows Builder Pattern. To make an instance of this class, use the code snippet something like below: JSONLexerErrorErrorHandlingOptions opts = JSONLexerErrorMessageConfiguration.builder() .showURI(false) .showLineAndColumnNumber(true) .showErrorLine(false) .failOnDuplicateKey(false) .failOnTooBigNumber(false) .warningStream(System.err) .build();The invocation of methods between builder()andJSONParserErrorHandlingOptions.Builder.build()are optional. If you want to use the default configuration, just do not call them.The default value may change in the future, so do not rely on them if you really need a specific error handling behavior. 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classJSONParserErrorHandlingOptions.BuilderBuilder class ofJSONParserErrorHandlingOptions.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JSONParserErrorHandlingOptions.Builderbuilder()Returns a new builder of this class.booleanfailOnDuplicateKey()Returns whether the parse should throw an exception when it encounters duplicated keys in one JSON object.booleanfailOnTooBigNumber()Returns whether the parse should throw an exception when there is a number that is not in the range [-(2^53)+1, 2^53 - 1].booleanshowErrorLine()Returns whether an error message should show actual JSON text line where the problme happened with markers to indicate which character(s) have the problem.booleanshowLineAndColumnNumber()Returns whether an error message should show line and column number instead of character position within a JSON text sourcebooleanshowURI()Returns whether an error message should show URI of a JSON text source instead of a short name.@Nullable PrintStreamwarningStream()Returns the stream where warnings should be printed.
 
- 
- 
- 
Method Detail- 
showURIpublic boolean showURI() Returns whether an error message should show URI of a JSON text source instead of a short name.- Returns:
- represents whether an error message should show URI
 
 - 
showLineAndColumnNumberpublic boolean showLineAndColumnNumber() Returns whether an error message should show line and column number instead of character position within a JSON text source- Returns:
- represents whether an error message should show line and column number instead of character position within a JSON text source
 
 - 
showErrorLinepublic boolean showErrorLine() Returns whether an error message should show actual JSON text line where the problme happened with markers to indicate which character(s) have the problem.- Returns:
- represents whether an error message should show actual JSON text line where the problem happened with markers to indicate which character(s) have the problem.
 
 - 
failOnDuplicateKeypublic boolean failOnDuplicateKey() Returns whether the parse should throw an exception when it encounters duplicated keys in one JSON object.- Returns:
- whether the parse should throw an exception when it encounters duplicated keys
 
 - 
failOnTooBigNumberpublic boolean failOnTooBigNumber() Returns whether the parse should throw an exception when there is a number that is not in the range [-(2^53)+1, 2^53 - 1].As indicated by RFC 8259 - 6. Numbers, some JSON parser implementations may internally covert a number to a double precision floating point value regardless whether it is an integer or not. To maximize the interoperability, it is a good idea to keep the number within this range so that not information loss occurs for integer values. This option enforces that policy to the users. - Returns:
- whether the parse should throw an exception when there is a number that is not in the range [-(2^53)+1, 2^53-1].
 
 - 
warningStream@Nullable public @Nullable PrintStream warningStream() Returns the stream where warnings should be printed.- Returns:
- the stream where warnings should be printed. Null to print warnings nowhere.
 
 - 
builderpublic static JSONParserErrorHandlingOptions.Builder builder() Returns a new builder of this class.- Returns:
- a new builder of this class
 
 
- 
 
-