Package net.minidev.json.parser
Class ParseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- net.minidev.json.parser.ParseException
-
- All Implemented Interfaces:
java.io.Serializable
public class ParseException extends java.lang.Exception
ParseException explains why and where the error occurs in source JSON text.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
ERROR_UNEXPECTED_CHAR
static int
ERROR_UNEXPECTED_DUPLICATE_KEY
static int
ERROR_UNEXPECTED_EOF
static int
ERROR_UNEXPECTED_EXCEPTION
static int
ERROR_UNEXPECTED_LEADING_0
static int
ERROR_UNEXPECTED_TOKEN
static int
ERROR_UNEXPECTED_UNICODE
private int
errorType
private int
position
private static long
serialVersionUID
private java.lang.Object
unexpectedObject
-
Constructor Summary
Constructors Constructor Description ParseException(int position, int errorType, java.lang.Object unexpectedObject)
ParseException(int position, java.lang.Throwable cause)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getErrorType()
int
getPosition()
java.lang.Object
getUnexpectedObject()
private static java.lang.String
toMessage(int position, int errorType, java.lang.Object unexpectedObject)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
ERROR_UNEXPECTED_CHAR
public static final int ERROR_UNEXPECTED_CHAR
- See Also:
- Constant Field Values
-
ERROR_UNEXPECTED_TOKEN
public static final int ERROR_UNEXPECTED_TOKEN
- See Also:
- Constant Field Values
-
ERROR_UNEXPECTED_EXCEPTION
public static final int ERROR_UNEXPECTED_EXCEPTION
- See Also:
- Constant Field Values
-
ERROR_UNEXPECTED_EOF
public static final int ERROR_UNEXPECTED_EOF
- See Also:
- Constant Field Values
-
ERROR_UNEXPECTED_UNICODE
public static final int ERROR_UNEXPECTED_UNICODE
- See Also:
- Constant Field Values
-
ERROR_UNEXPECTED_DUPLICATE_KEY
public static final int ERROR_UNEXPECTED_DUPLICATE_KEY
- See Also:
- Constant Field Values
-
ERROR_UNEXPECTED_LEADING_0
public static final int ERROR_UNEXPECTED_LEADING_0
- See Also:
- Constant Field Values
-
errorType
private int errorType
-
unexpectedObject
private java.lang.Object unexpectedObject
-
position
private int position
-
-
Method Detail
-
getErrorType
public int getErrorType()
-
getPosition
public int getPosition()
- Returns:
- The character position (starting with 0) of the input where the error occurs.
-
getUnexpectedObject
public java.lang.Object getUnexpectedObject()
- Returns:
- One of the following base on the value of errorType: ERROR_UNEXPECTED_CHAR java.lang.Character ERROR_UNEXPECTED_TOKEN ERROR_UNEXPECTED_EXCEPTION java.lang.Exception
-
toMessage
private static java.lang.String toMessage(int position, int errorType, java.lang.Object unexpectedObject)
-
-