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/). It provides the following Functionality:
  • Error - Unexpected Character
  • Error - Unexpected Token
  • Error - Unexpected Exception
  • ParseException Constructor #1
  • ParseException Constructor #2
  • ParseException Constructor #3
  • Retrieve the Error Type
  • Set the Error Type
  • Get the Position
  • Set the Position
  • Get the Unexpected Object
  • Set the Unexpected Object
  • String Version of the State

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 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 #3
    ParseException​(int position, int errorType, java.lang.Object unexpectedObject)
    ParseException Constructor #1
    ParseException​(int errorType, java.lang.Object unexpectedObject)
    ParseException Constructor #2
  • Method Summary

    Modifier and Type Method Description
    int getErrorType()
    Retrieve the Error Type
    int getPosition()
    Get the Position
    java.lang.Object getUnexpectedObject()
    Get the Unexpected Object
    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()
    String Version of the State

    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 position, int errorType, java.lang.Object unexpectedObject)
      ParseException Constructor #1
      Parameters:
      position - Position
      errorType - Error Type
      unexpectedObject - Unexpected Object
    • ParseException

      public ParseException​(int errorType, java.lang.Object unexpectedObject)
      ParseException Constructor #2
      Parameters:
      errorType - Error Type
      unexpectedObject - Unexpected Error Object
    • ParseException

      public ParseException​(int errorType)
      ParseException Constructor #3
      Parameters:
      errorType - Error Type
  • 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()
      Get the Position
      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()
      Get the Unexpected Object
      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()
      String Version of the State
      Overrides:
      toString in class java.lang.Throwable
      Returns:
      String Version of the State