Package org.json.simple.parser
Class ParseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.json.simple.parser.ParseException
-
- All Implemented Interfaces:
java.io.Serializable
public class ParseException extends java.lang.ExceptionParseException explains why and where the error occurs in source JSON text.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intERROR_UNEXPECTED_CHARstatic intERROR_UNEXPECTED_EXCEPTIONstatic intERROR_UNEXPECTED_TOKENprivate interrorTypeprivate intpositionprivate static longserialVersionUIDprivate java.lang.ObjectunexpectedObject
-
Constructor Summary
Constructors Constructor Description ParseException(int errorType)ParseException(int position, int errorType, java.lang.Object unexpectedObject)ParseException(int errorType, java.lang.Object unexpectedObject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetErrorType()intgetPosition()java.lang.ObjectgetUnexpectedObject()voidsetErrorType(int errorType)voidsetPosition(int position)voidsetUnexpectedObject(java.lang.Object unexpectedObject)java.lang.StringtoString()
-
-
-
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
-
errorType
private int errorType
-
unexpectedObject
private java.lang.Object unexpectedObject
-
position
private int position
-
-
Method Detail
-
getErrorType
public int getErrorType()
-
setErrorType
public void setErrorType(int errorType)
-
getPosition
public int getPosition()
- Returns:
- The character position (starting with 0) of the input where the error occurs.
- See Also:
JSONParser.getPosition()
-
setPosition
public void setPosition(int position)
-
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 org.json.simple.parser.Yytoken ERROR_UNEXPECTED_EXCEPTION java.lang.Exception
- See Also:
Yytoken
-
setUnexpectedObject
public void setUnexpectedObject(java.lang.Object unexpectedObject)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Throwable
-
-