程序包 com.script
类 ScriptException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.script.ScriptException
- 所有已实现的接口:
Serializable
The generic
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.- 从以下版本开始:
- 1.6
- 另请参阅:
-
构造器概要
构造器构造器说明Creates aScriptExceptionwrapping anExceptionthrown by an underlying interpreter.Creates aScriptExceptionwith a String to be used in its message.ScriptException(String message, String fileName, int lineNumber) Creates aScriptExceptionwith message, filename and linenumber to be used in error messages.ScriptException(String message, String fileName, int lineNumber, int columnNumber) ScriptExceptionconstructor specifying message, filename, line number and column number. -
方法概要
修饰符和类型方法说明intGet the column number on which an error occurred.Get the source of the script causing the error.intGet the line number on which an error occurred.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.
-
构造器详细资料
-
ScriptException
Creates aScriptExceptionwith a String to be used in its message. Filename, and line and column numbers are unspecified.- 参数:
s- The String to use in the message.
-
ScriptException
Creates aScriptExceptionwrapping anExceptionthrown by an underlying interpreter. Line and column numbers and filename are unspecified.- 参数:
e- The wrappedException.
-
ScriptException
Creates aScriptExceptionwith message, filename and linenumber to be used in error messages.- 参数:
message- The string to use in the messagefileName- The file or resource name describing the location of a script error causing theScriptExceptionto be thrown.lineNumber- A line number describing the location of a script error causing theScriptExceptionto be thrown.
-
ScriptException
ScriptExceptionconstructor specifying message, filename, line number and column number.- 参数:
message- The message.fileName- The filenamelineNumber- the line number.columnNumber- the column number.
-
-
方法详细资料
-
getMessage
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.- 覆盖:
getMessage在类中Throwable- 返回:
- The error message.
-
getLineNumber
public int getLineNumber()Get the line number on which an error occurred.- 返回:
- The line number. Returns -1 if a line number is unavailable.
-
getColumnNumber
public int getColumnNumber()Get the column number on which an error occurred.- 返回:
- The column number. Returns -1 if a column number is unavailable.
-
getFileName
Get the source of the script causing the error.- 返回:
- 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.
-