public class JSONParseException
extends java.lang.RuntimeException
Exception that is thrown when invalid JSON is encountered by the parser.
The error message is formatted so that it points to the first.
This exception creates a message that points to the first offending character in the JSON string:
{ "x" : 3, "y" : 4, some invalid json.... } ^
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
jsonString |
(package private) int |
pos |
private static long |
serialVersionUID |
Constructor and Description |
---|
JSONParseException(java.lang.String jsonString,
int position)
Creates a new instance.
|
JSONParseException(java.lang.String jsonString,
int position,
java.lang.Throwable cause)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMessage() |
private static final long serialVersionUID
final java.lang.String jsonString
final int pos
public JSONParseException(java.lang.String jsonString, int position)
jsonString
- the JSON being parsedposition
- the position of the failurepublic JSONParseException(java.lang.String jsonString, int position, java.lang.Throwable cause)
jsonString
- the JSON being parsedposition
- the position of the failurecause
- the root cause