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/).

Author:
Fang Yidong, Lakshmi Krishnamurthy
See Also:
Serialized Form
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int ERROR_UNEXPECTED_CHAR
    Error - Unexpected Character
    static int ERROR_UNEXPECTED_EXCEPTION
    Error - Unexpected Exception
    static int ERROR_UNEXPECTED_TOKEN
    Error - Unexpected Token
  • Constructor Summary

    Constructors
    Constructor Description
    ParseException​(int errorType)
    ParseException Constructor
    ParseException​(int position, int errorType, java.lang.Object unexpectedObject)
    ParseException Constructor
    ParseException​(int errorType, java.lang.Object unexpectedObject)
    ParseException Constructor
  • Method Summary

    Modifier and Type Method Description
    int getErrorType()
    Retrieve the Error Type
    int getPosition()  
    java.lang.Object getUnexpectedObject()  
    void setErrorType​(int errorType)
    Set the Error Type
    void setPosition​(int position)
    Set the Position
    void setUnexpectedObject​(java.lang.Object unexpectedObject)
    Set the Unexpected Object
    java.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_CHAR
      Error - Unexpected Character
      See Also:
      Constant Field Values
    • ERROR_UNEXPECTED_TOKEN

      public static final int ERROR_UNEXPECTED_TOKEN
      Error - Unexpected Token
      See Also:
      Constant Field Values
    • ERROR_UNEXPECTED_EXCEPTION

      public static final int ERROR_UNEXPECTED_EXCEPTION
      Error - 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 Type
      unexpectedObject - Unexpected Error Object
    • ParseException

      public ParseException​(int position, int errorType, java.lang.Object unexpectedObject)
      ParseException Constructor
      Parameters:
      position - Position
      errorType - Error Type
      unexpectedObject - 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 class java.lang.Throwable