public class ScriptException extends 异常
异常
类脚本API。检查的异常类型的基本的脚本实现抛必须要用实例
ScriptException
。类成员存储行号和列号和文件名,如果这个信息是可用的。
Constructor and Description |
---|
ScriptException(异常 e)
创建一个
ScriptException 包装
异常 由底层解释器抛出。
|
ScriptException(String s)
创建一个字符串作为其消息
ScriptException 。
|
ScriptException(String message, String fileName, int lineNumber)
创建一个
ScriptException 消息,文件名和行号用于错误信息。
|
ScriptException(String message, String fileName, int lineNumber, int columnNumber)
ScriptException 构造函数指定消息、文件名、行号和列号。
|
Modifier and Type | Method and Description |
---|---|
int |
getColumnNumber()
获取发生错误的列号。
|
String |
getFileName()
获取导致错误的脚本的源。
|
int |
getLineNumber()
获取发生错误的行数。
|
String |
getMessage()
返回一个消息,该消息包含传递给一个构造函数的字符串以及这些已知的行和列的数字和文件名。
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ScriptException(String s)
ScriptException
。文件名,和行和列号是未指定的。
s
-使用消息中的字符串。
public ScriptException(异常 e)
ScriptException
包装
异常
由底层解释器抛出。行和列号和文件名是未指定的。
e
-包装
异常
。
public ScriptException(String message, String fileName, int lineNumber)
ScriptException
消息,文件名和行号用于错误信息。
message
-使用消息中的字符串
fileName
-文件或资源名称描述脚本错误造成的
ScriptException
被抛出的位置。
lineNumber
-线数描述脚本错误造成的
ScriptException
被抛出的位置。
public String getMessage()
getMessage
方法重写,继承类
Throwable
public int getLineNumber()
public int getColumnNumber()
public String getFileName()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.