Class ParserException

java.lang.Object
java.lang.Throwable
java.lang.Exception
gov.nih.mipav.model.scripting.ParserException
All Implemented Interfaces:
Serializable

public class ParserException extends Exception
Provides information about an error encountered while parsing a script.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • lineNumber

      private int lineNumber
      The line number in the script where this error occurred.
    • parsedFileName

      private String parsedFileName
      The file name of the script where this error occurred ('-' if no corresponding file on disk).
  • Constructor Details

    • ParserException

      public ParserException(String message)
      Creates a new ParserException object. Defaults the error occurring on line 0 of non-file '-'.
      Parameters:
      message - A message describing the problem.
    • ParserException

      public ParserException(String file, int line, String message)
      Creates a new ParserException object.
      Parameters:
      file - The file the script was read in from on disk ('-' if no file).
      line - The line in the script where the problem happened.
      message - A message describing the problem.
  • Method Details

    • getLineNumber

      public int getLineNumber()
      Return the line number in the script where the problem occurred.
      Returns:
      The line number in the script where the problem occurred.
    • getParsedFileName

      public String getParsedFileName()
      Return the file that the script was read in from ('-' if no file on disk).
      Returns:
      The file that the script was read in from.
    • setLineNumber

      public void setLineNumber(int line)
      Changes the line number in the script where the problem happened.
      Parameters:
      line - The line number in the script with the error.
    • setParsedFileName

      public void setParsedFileName(String file)
      Changes the file from which the script was read in ('-' if no file on disk).
      Parameters:
      file - The file from which the script was read in.
    • toString

      public String toString()
      Converts the information contained in this exception to a String suitable for display to the user.
      Overrides:
      toString in class Throwable
      Returns:
      Information about the error encountered.