Package org.drip.service.jsonparser
Class ParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.drip.service.jsonparser.ParseException
- All Implemented Interfaces:
java.io.Serializable
public class ParseException
extends java.lang.Exception
ParseException is an Adaptation of the ParseException Class from the RFC4627 compliant JSON Simple
(https://code.google.com/p/json-simple/).
- Module = Computational Core Module
- Library = Computation Support
- Project = Environment, Product/Definition Containers, and Scenario/State Manipulation APIs
- Package = RFC4627 Compliant JSON Message Parser
- Author:
- Fang Yidong, Lakshmi Krishnamurthy
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static int
ERROR_UNEXPECTED_CHAR
Error - Unexpected Characterstatic int
ERROR_UNEXPECTED_EXCEPTION
Error - Unexpected Exceptionstatic int
ERROR_UNEXPECTED_TOKEN
Error - Unexpected Token -
Constructor Summary
Constructors Constructor Description ParseException(int errorType)
ParseException ConstructorParseException(int position, int errorType, java.lang.Object unexpectedObject)
ParseException ConstructorParseException(int errorType, java.lang.Object unexpectedObject)
ParseException Constructor -
Method Summary
Modifier and Type Method Description int
getErrorType()
Retrieve the Error Typeint
getPosition()
java.lang.Object
getUnexpectedObject()
void
setErrorType(int errorType)
Set the Error Typevoid
setPosition(int position)
Set the Positionvoid
setUnexpectedObject(java.lang.Object unexpectedObject)
Set the Unexpected Objectjava.lang.String
toString()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
ERROR_UNEXPECTED_CHAR
public static final int ERROR_UNEXPECTED_CHARError - Unexpected Character- See Also:
- Constant Field Values
-
ERROR_UNEXPECTED_TOKEN
public static final int ERROR_UNEXPECTED_TOKENError - Unexpected Token- See Also:
- Constant Field Values
-
ERROR_UNEXPECTED_EXCEPTION
public static final int ERROR_UNEXPECTED_EXCEPTIONError - Unexpected Exception- See Also:
- Constant Field Values
-
-
Constructor Details
-
ParseException
public ParseException(int errorType)ParseException Constructor- Parameters:
errorType
- Error Type
-
ParseException
public ParseException(int errorType, java.lang.Object unexpectedObject)ParseException Constructor- Parameters:
errorType
- Error TypeunexpectedObject
- Unexpected Error Object
-
ParseException
public ParseException(int position, int errorType, java.lang.Object unexpectedObject)ParseException Constructor- Parameters:
position
- PositionerrorType
- Error TypeunexpectedObject
- Unexpected Object
-
-
Method Details
-
getErrorType
public int getErrorType()Retrieve the Error Type- Returns:
- The Error Type
-
setErrorType
public void setErrorType(int errorType)Set the Error Type- Parameters:
errorType
- The Error Type
-
getPosition
public int getPosition()- Returns:
- The character position (starting with 0) of the input where the error occurs.
- See Also:
LexicalProcessor.getPosition()
-
setPosition
public void setPosition(int position)Set the Position- Parameters:
position
- The 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)Set the Unexpected Object- Parameters:
unexpectedObject
- The Unexpected Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Throwable
-