Package gov.nih.mipav.model.scripting
Class ParserException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- gov.nih.mipav.model.scripting.ParserException
-
- All Implemented Interfaces:
java.io.Serializable
public class ParserException extends java.lang.Exception
Provides information about an error encountered while parsing a script.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private int
lineNumber
The line number in the script where this error occurred.private java.lang.String
parsedFileName
The file name of the script where this error occurred ('-' if no corresponding file on disk).private static long
serialVersionUID
Use serialVersionUID for interoperability.
-
Constructor Summary
Constructors Constructor Description ParserException(java.lang.String message)
Creates a new ParserException object.ParserException(java.lang.String file, int line, java.lang.String message)
Creates a new ParserException object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLineNumber()
Return the line number in the script where the problem occurred.java.lang.String
getParsedFileName()
Return the file that the script was read in from ('-' if no file on disk).void
setLineNumber(int line)
Changes the line number in the script where the problem happened.void
setParsedFileName(java.lang.String file)
Changes the file from which the script was read in ('-' if no file on disk).java.lang.String
toString()
Converts the information contained in this exception to a String suitable for display to the user.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
lineNumber
private int lineNumber
The line number in the script where this error occurred.
-
parsedFileName
private java.lang.String parsedFileName
The file name of the script where this error occurred ('-' if no corresponding file on disk).
-
-
Constructor Detail
-
ParserException
public ParserException(java.lang.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(java.lang.String file, int line, java.lang.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 Detail
-
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 java.lang.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(java.lang.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 java.lang.String toString()
Converts the information contained in this exception to a String suitable for display to the user.- Overrides:
toString
in classjava.lang.Throwable
- Returns:
- Information about the error encountered.
-
-