类 NestedCheckedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
cn.taketoday.core.NestedCheckedException
- 所有已实现的接口:
Serializable
Handy class for wrapping checked
Exceptions with a root cause.
This class is abstract to force the programmer to extend the class.
The similarity between this class and the NestedRuntimeException
class is unavoidable, as Java forces these two classes to have different
superclasses (ah, the inflexibility of concrete inheritance!).
- 从以下版本开始:
- 3.0
- 作者:
- Rod Johnson, Juergen Hoeller, TODAY 2021/2/2 11:13
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器构造器说明Construct aNestedCheckedExceptionwith the specified detail message.NestedCheckedException(String msg, Throwable cause) Construct aNestedCheckedExceptionwith the specified detail message and nested exception.NestedCheckedException(Throwable cause) Construct aNestedCheckedExceptionwith the specified nested exception. -
方法概要
修饰符和类型方法说明booleanCheck whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.Return the detail message, including the message from the nested exception if there is one.Retrieve the innermost cause of this exception, if any.
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
-
构造器详细资料
-
NestedCheckedException
public NestedCheckedException() -
NestedCheckedException
Construct aNestedCheckedExceptionwith the specified detail message.- 参数:
msg- the detail message
-
NestedCheckedException
Construct aNestedCheckedExceptionwith the specified nested exception.- 参数:
cause- the nested exception
-
NestedCheckedException
Construct aNestedCheckedExceptionwith the specified detail message and nested exception.- 参数:
msg- the detail messagecause- the nested exception
-
-
方法详细资料
-
getNestedMessage
Return the detail message, including the message from the nested exception if there is one.- 从以下版本开始:
- 4.0
-
getRootCause
Retrieve the innermost cause of this exception, if any.- 返回:
- the innermost exception, or
nullif none
-
getMostSpecificCause
Retrieve the most specific cause of this exception, that is, either the innermost cause (root cause) or this exception itself.Differs from
getRootCause()in that it falls back to the present exception if there is no root cause.- 返回:
- the most specific cause (never
null)
-
contains
Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.- 参数:
exType- the exception type to look for- 返回:
- whether there is a nested exception of the specified type
-