|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.reflect.UndeclaredThrowableException
public class UndeclaredThrowableException
如果代理實例的調用處理程序的 invoke 方法拋出一個經過檢查的異常(不可分派給 RuntimeException 或 Error 的 Throwable),且該異常不可分派給該方法(在代理實例上調用該方法,並將其指派到調用處理程序)的 throws 子句中宣告的任何異常類別,則由代理實例上的方法調用拋出此異常。
UndeclaredThrowableException 實例包含由調用處理程序拋出的經過檢查的未宣告異常,而且可以使用 getUndeclaredThrowable() 方法獲取。UndeclaredThrowableException 擴展了 RuntimeException,因此它是一個套件裝已檢查異常的未經檢查的異常。
從版本 1.4 開始,此異常已經更新,符合常用的異常鏈機制。「由調用處理程序拋出的經過檢查的未宣告異常」可以在建構的時候提供,並且可以通過 getUndeclaredThrowable() 方法存取,這類別物件目前被認為是導致異常的原因,可以通過 Throwable.getCause() 方法以及前面提到的「遺留方法」存取它。
InvocationHandler,
序列化表格| 建構子摘要 | |
|---|---|
UndeclaredThrowableException(Throwable undeclaredThrowable)
根據指定的 Throwable 建構一個 UndeclaredThrowableException。 |
|
UndeclaredThrowableException(Throwable undeclaredThrowable,
String s)
根據指定的 Throwable 和詳細訊息建構 UndeclaredThrowableException。 |
|
| 方法摘要 | |
|---|---|
Throwable |
getCause()
返回此異常的原因(此 UndeclaredThrowableException 中包裹的 Throwable 實例,可能為 null)。 |
Throwable |
getUndeclaredThrowable()
返回此 UndeclaredThrowableException 中包裹的 Throwable 實例,它可能為 null。 |
| 從類別 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 UndeclaredThrowableException(Throwable undeclaredThrowable)
Throwable 建構一個 UndeclaredThrowableException。
undeclaredThrowable - 拋出的經過檢查的未宣告異常
public UndeclaredThrowableException(Throwable undeclaredThrowable,
String s)
Throwable 和詳細訊息建構 UndeclaredThrowableException。
undeclaredThrowable - 拋出的經過檢查的未宣告異常s - 詳細訊息| 方法詳細資訊 |
|---|
public Throwable getUndeclaredThrowable()
UndeclaredThrowableException 中包裹的 Throwable 實例,它可能為 null。
該方法早於通用異常鏈設施。Throwable.getCause() 方法現在是獲得此資訊的首選方法。
public Throwable getCause()
UndeclaredThrowableException 中包裹的 Throwable 實例,可能為 null)。
Throwable 中的 getCause
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。