|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Error
java.lang.LinkageError
java.lang.ExceptionInInitializerError
public class ExceptionInInitializerError
静态初始化程序中发生意外异常的信号。抛出 ExceptionInInitializerError 表明在计算静态初始值或静态变量的初始值期间发生异常。
从版本 1.4 开始,这个异常已经更新过,符合通用异常链机制。“保存的 throwable 对象”可能是在构造的时候提供的,并且可以通过 getException() 方法来访问,这类对象目前被认为是导致异常的原因,可以通过 Throwable.getCause() 方法以及前面提到的“遗留方法”访问它。
| 构造方法摘要 | |
|---|---|
ExceptionInInitializerError()
构造一个 ExceptionInInitializerError,使用 null 作为其详细消息字符串,并且不使用任何保存的 throwable 对象。 |
|
ExceptionInInitializerError(String s)
构造带指定详细消息的 ExceptionInInitializerError。 |
|
ExceptionInInitializerError(Throwable thrown)
保存对抛出的 Throwable 对象的引用,以便以后通过 getException() 方法对其进行获取,通过这种方式构造一个新的 ExceptionInInitializerError 类。 |
|
| 方法摘要 | |
|---|---|
Throwable |
getCause()
返回导致该错误的原因(导致发生此错误的静态初始化期间发生的异常)。 |
Throwable |
getException()
返回静态初始化期间发生的异常,该异常导致发生此错误。 |
| 从类 java.lang.Throwable 继承的方法 |
|---|
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 构造方法详细信息 |
|---|
public ExceptionInInitializerError()
ExceptionInInitializerError,使用 null 作为其详细消息字符串,并且不使用任何保存的 throwable 对象。详细消息是描述这个特定异常的 String。
public ExceptionInInitializerError(Throwable thrown)
Throwable 对象的引用,以便以后通过 getException() 方法对其进行获取,通过这种方式构造一个新的 ExceptionInInitializerError 类。 详细消息字符串被设置为 null。
thrown - 抛出的异常public ExceptionInInitializerError(String s)
Throwable.getMessage() 方法对其进行获取。没有任何保存的 throwable 对象。
s - 详细消息| 方法详细信息 |
|---|
public Throwable getException()
该方法早于通用异常链设施。 Throwable.getCause() 方法现在首先被用来获得该信息。
ExceptionInInitializerError 的已保存的 throwable 对象;如果此 ExceptionInInitializerError 没有任何已保存的 throwable 对象,则返回 null。public Throwable getCause()
Throwable 中的 getCausenull。
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。