java.lang.Object
java.lang.Throwable
java.lang.Exception
de.ralleytn.simple.json.JSONParseException
- All Implemented Interfaces:
Serializable
Is thrown when an error occurs while parsing JSON data.
Explains what the problem is.
- Since:
- 1.0.0
- Version:
- 2.1.0
- Author:
- FangYidong(fangyidong@yahoo.com.cn), Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionJSONParseException
(int errorType) JSONParseException
(int position, int errorType, Object unexpectedObject) JSONParseException
(int errorType, Object unexpectedObject) -
Method Summary
Modifier and TypeMethodDescriptionint
int
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
ERROR_UNEXPECTED_CHAR
public static final int ERROR_UNEXPECTED_CHAR- Since:
- 1.0.0
- See Also:
-
ERROR_UNEXPECTED_TOKEN
public static final int ERROR_UNEXPECTED_TOKEN- Since:
- 1.0.0
- See Also:
-
ERROR_UNEXPECTED_EXCEPTION
public static final int ERROR_UNEXPECTED_EXCEPTION- Since:
- 1.0.0
- See Also:
-
-
Constructor Details
-
JSONParseException
public JSONParseException(int errorType) - Parameters:
errorType
- the error type- Since:
- 1.0.0
-
JSONParseException
- Parameters:
errorType
- the error typeunexpectedObject
- the object that represents what was unexpected- Since:
- 1.0.0
-
JSONParseException
- Parameters:
position
- the character position (starting with 0) of the input where the error occurrederrorType
- the error typeunexpectedObject
- the object that represents what was unexpected- Since:
- 1.0.0
-
-
Method Details
-
getErrorType
public int getErrorType()- Returns:
- the error type
- Since:
- 1.0.0
-
getPosition
public int getPosition()- Returns:
- the character position (starting with 0) of the input where the error occurred
- Since:
- 1.0.0
-
getUnexpectedObject
- Returns:
- one of the following base on the value of errorType:
error type object type ERROR_UNEXPECTED_CHAR
Character ERROR_UNEXPECTED_TOKEN
Yytoken ERROR_UNEXPECTED_EXCEPTION
Exception - Since:
- 1.0.0
-
getMessage
- Overrides:
getMessage
in classThrowable
-