Class ParserException

All Implemented Interfaces:
Serializable

public final class ParserException extends RuntimeException
ECMAScript parser exceptions.
See Also:
  • Constructor Details

    • ParserException

      public ParserException(String msg)
      Constructor.
      Parameters:
      msg - exception message for this parser error.
    • ParserException

      public ParserException(JSErrorType errorType, String msg, Source source, int line, int column, long token)
      Constructor.
      Parameters:
      errorType - error type
      msg - exception message
      source - source from which this exception originates
      line - line number of exception
      column - column number of exception
      token - token from which this exception originates
  • Method Details

    • getFileName

      public String getFileName()
      Get the source file name for this ParserException.
      Returns:
      the file name
    • setFileName

      public void setFileName(String fileName)
      Set the source file name for this ParserException.
      Parameters:
      fileName - the file name
    • getLineNumber

      public int getLineNumber()
      Get the line number for this ParserException.
      Returns:
      the line number
    • setLineNumber

      public void setLineNumber(int line)
      Set the line number for this ParserException.
      Parameters:
      line - the line number
    • getColumnNumber

      public int getColumnNumber()
      Get the column for this ParserException.
      Returns:
      the column number
    • setColumnNumber

      public void setColumnNumber(int column)
      Set the column for this ParserException.
      Parameters:
      column - the column number
    • getSource

      public Source getSource()
      Get the Source of this ParserException.
      Returns:
      source
    • getToken

      public long getToken()
      Get the token responsible for this ParserException.
      Returns:
      token
    • getPosition

      public int getPosition()
      Get token position within source where the error originated.
      Returns:
      token position if available, else -1
    • getErrorType

      public JSErrorType getErrorType()
      Get the JSErrorType of this ParserException.
      Returns:
      error type
    • isIncompleteSource

      public boolean isIncompleteSource()
    • getRawMessage

      public String getRawMessage()
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable