Class 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
    • 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
      int getErrorType()
      Action on data for a result.
      java.lang.String getMessage()  
      int getPosition()  
      java.lang.Object getUnexpectedObject()  
      void setErrorType​(int errorType)
      Action on data for a result.
      void setPosition​(int position)
      Action on data for a result.
      void setUnexpectedObject​(java.lang.Object unexpectedObject)
      Action on data for a result.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • ERROR_UNEXPECTED_CHAR

        public static final int ERROR_UNEXPECTED_CHAR
        description omitted.
        See Also:
        Constant Field Values
      • ERROR_UNEXPECTED_TOKEN

        public static final int ERROR_UNEXPECTED_TOKEN
        description omitted.
        See Also:
        Constant Field Values
      • ERROR_UNEXPECTED_EXCEPTION

        public static final int ERROR_UNEXPECTED_EXCEPTION
        description omitted.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ParseException

        public ParseException​(int errorType)
        Parameters:
        errorType - description omitted.
      • ParseException

        public ParseException​(int errorType,
                              java.lang.Object unexpectedObject)
        Parameters:
        errorType - description omitted.
        unexpectedObject - description omitted.
      • ParseException

        public ParseException​(int position,
                              int errorType,
                              java.lang.Object unexpectedObject)
        Parameters:
        position - description omitted.
        errorType - description omitted.
        unexpectedObject - description omitted.
    • Method Detail

      • getErrorType

        public int getErrorType()
        Action on data for a result.
        Returns:
        description omitted.
      • setErrorType

        public void setErrorType​(int errorType)
        Action on data for a result.
        Parameters:
        errorType - description omitted.
      • 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)
        Action on data for a result.
        Parameters:
        position - description omitted.
      • 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)
        Action on data for a result.
        Parameters:
        unexpectedObject - description omitted.
      • getMessage

        public java.lang.String getMessage()
        Overrides:
        getMessage in class java.lang.Throwable