Exception
class for the Scripting APIs. Checked
exception types thrown by underlying scripting implementations must be wrapped in instances of
ScriptException
. The class has members to store line and column numbers and
filenames if this information is available.
Modifier and Type | Field and Description |
---|---|
private final int | |
private final String | |
private final int | |
private static final long |
Access | Constructor and Description |
---|---|
public | ScriptException(String
The String to use in the message. s)Creates a |
public | ScriptException(Exception
The wrapped e)Exception .Creates a |
public | ScriptException(String
The string to use in the message message, String The file or resource name describing the location of a script error
causing the fileName, int ScriptException to be thrown.A line number describing the location of a script error causing
the lineNumber)ScriptException to be thrown.Creates a |
public | ScriptException(String
The message. message, String The filename fileName, int the line number. lineNumber, int the column number. columnNumber)
|
Modifier and Type | Method and Description |
---|---|
public int | Returns: The column number. Returns -1 if a column number is unavailable.Get the column number on which an error occurred. |
public String | Returns: The file name of the script or some other string describing the script source. May return some implementation-defined string such as <unknown> if a description of the source is unavailable.Get the source of the script causing the error. |
public int | Returns: The line number. Returns -1 if a line number is unavailable.Get the line number on which an error occurred. |
public String | Returns: The error message.Overrides java. |
columnNumber | back to summary |
---|---|
private final int columnNumber |
fileName | back to summary |
---|---|
private final String fileName |
lineNumber | back to summary |
---|---|
private final int lineNumber |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID |
ScriptException | back to summary |
---|---|
public ScriptException(String s) Creates a
|
ScriptException | back to summary |
---|---|
public ScriptException(Exception e) Creates a
|
ScriptException | back to summary |
---|---|
public ScriptException(String message, String fileName, int lineNumber) Creates a |
ScriptException | back to summary |
---|---|
public ScriptException(String message, String fileName, int lineNumber, int columnNumber)
|
getColumnNumber | back to summary |
---|---|
public int getColumnNumber() Get the column number on which an error occurred.
|
getFileName | back to summary |
---|---|
public String getFileName() Get the source of the script causing the error.
|
getLineNumber | back to summary |
---|---|
public int getLineNumber() Get the line number on which an error occurred.
|
getMessage | back to summary |
---|---|
public String getMessage() Overrides java. Returns a message containing the String passed to a constructor as well as line and column numbers and filename if any of these are known.
|