|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.apache.commons.lang.exception.ExceptionUtils
Throwable オブジェクトを処理するためのユーティリティルーチンです。
Throwable objects.
| フィールドの概要 | |
protected static String[] |
CAUSE_METHOD_NAMES
ラップされている例外にアクセスする際に一般的に使用されるメソッドの名称。 |
protected static Object[] |
CAUSE_METHOD_PARAMS
ラップされている例外にアクセスする際に渡される空のパラメータリスト。 |
| コンストラクタの概要 | |
protected |
ExceptionUtils()
新規 ExceptionUtils を生成します。 |
| メソッドの概要 | |
static Throwable |
getCause(Throwable t)
指定された Throwable の Throwable オブジェクトを返す(標準の JDK 1.4 と
NestableException のAPIの)
getCause()、 getNextException()、
getTargetException()、 getException() メソッド
を利用して原因となる例外を抽出し、返します。
|
static Throwable |
getCause(Throwable t,
String[] methodNames)
getCause(Throwable) を指定されたメソッドのみを使用するように拡張します。
|
private static Throwable |
getCauseUsingFieldName(Throwable t,
String fieldName)
|
private static Throwable |
getCauseUsingMethodName(Throwable t,
String methodName)
|
private static Throwable |
getCauseUsingWellKnownTypes(Throwable t)
指定された例外に対して instanceof のチェックを行い
内部にネストされた例外を持ちうる想定された型であった場合、その内部の例外を返します。
|
static Throwable |
getRootCause(Throwable t)
getCause(Throwable) を使用して内部の例外をたどり、
根本の原因(root)となる例外を返します。
|
(パッケージプライベート) static String[] |
getStackFrames(String stackTrace)
このクラスの getStackFrames(Throwable) メソッドと
NestableDelegate
クラスにて使用される機能。
|
static String[] |
getStackFrames(Throwable t)
指定された Throwable に関連するスタックトレースを取得し、
スタックフレームの配列に分解します。
|
static String |
getStackTrace(Throwable t)
例外からスタックトレースを抜き出す簡単な方法を提供します。 |
static int |
getThrowableCount(Throwable t)
内部に含まれるネストされた例外をたどって設定されている Throwable オブジェクトの数を返します。
|
static Throwable[] |
getThrowables(Throwable t)
内部に含まれるネストされた例外をたどって設定されている Throwable オブジェクトを配列に格納し返します。
|
static int |
indexOfThrowable(Throwable t,
Class type)
indexOfThrowable(Throwable, Class, int) に処理を委譲し、
内部の例外の先頭から対象となる例外を検索します。
|
static int |
indexOfThrowable(Throwable t,
Class type,
int fromIndex)
内部の例外から指定された型に該当する Throwable を検索し、0から始まるインデックスを返します。
|
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
protected static final String[] CAUSE_METHOD_NAMES
protected static final Object[] CAUSE_METHOD_PARAMS
| コンストラクタの詳細 |
protected ExceptionUtils()
ExceptionUtils を生成します。インスタンス化を制限します。
ExceptionUtils. Protected to
discourage instantiation.
| メソッドの詳細 |
public static Throwable getCause(Throwable t)
Throwable の Throwable オブジェクトを返す(標準の JDK 1.4 と
NestableException のAPIの)
getCause()、 getNextException()、
getTargetException()、 getException() メソッド
を利用して原因となる例外を抽出し、返します。
上記のものが見つからない場合 null を返します。
Throwable for a
getCause(), getNextException(),
getTargetException(), or
getException() method which returns a
Throwable object (standard as of JDK 1.4, and part
of the {@link
org.apache.commons.lang.exception.NestableException} API),
extracting and returning the cause of the exception. In the
absence of any such method, the object is inspected for a
detail field assignable to a
Throwable. If none of the above is found, returns
null.
t - 内部にある原因となる例外
Throwable
Throwable.
public static Throwable getCause(Throwable t,
String[] methodNames)
getCause(Throwable) を指定されたメソッドのみを使用するように拡張します。
getCause(Throwable)public static Throwable getRootCause(Throwable t)
getCause(Throwable) を使用して内部の例外をたどり、
根本の原因(root)となる例外を返します。
Throwable.
Throwable.getCause(Throwable)private static Throwable getCauseUsingWellKnownTypes(Throwable t)
instanceof のチェックを行い
内部にネストされた例外を持ちうる想定された型であった場合、その内部の例外を返します。
instanceof checks to examine the exception,
looking for well known types which could contain chained or
wrapped exceptions.
t - 調査対象となる例外
null
null if not
found.
private static Throwable getCauseUsingMethodName(Throwable t,
String methodName)
t - 調査対象となる例外
methodName - 検索し、実行するメソッド名
null
null if not
found.
private static Throwable getCauseUsingFieldName(Throwable t,
String fieldName)
t - 調査対象となる例外
fieldName - 調査対象となる属性(フィールド)名
null
null if not
found.public static int getThrowableCount(Throwable t)
Throwable オブジェクトの数を返します。
Throwable objects in the
exception chain.
t - 調査対象となる例外
public static Throwable[] getThrowables(Throwable t)
Throwable オブジェクトを配列に格納し返します。
Throwable objects in the
exception chain.
t - 調査対象となる例外
Throwable オブジェクトの配列。
Throwable objects.
public static int indexOfThrowable(Throwable t,
Class type)
indexOfThrowable(Throwable, Class, int) に処理を委譲し、
内部の例外の先頭から対象となる例外を検索します。
indexOfThrowable(Throwable, Class, int)
public static int indexOfThrowable(Throwable t,
Class type,
int fromIndex)
Throwable を検索し、0から始まるインデックスを返します。
指定されたインデックス位置から検索を実施します。
該当するものが見つからなかった場合には -1 を返します。
Throwable that matches the specified type in the
exception chain of Throwable objects with an index
greater than or equal to the specified index, or
-1 if the type is not found.
t - 調査対象となる例外
type - 検索対象となる Class
Class to look for.fromIndex - 検索を開始する位置となる0から始まるインデックス
-1
-1 if the type is not found.IndexOutOfBoundsException - fromIndex がマイナスだった場合
または内部に含まれる Throwable の数より大きかった場合
fromIndex
argument is negative or not less than the count of
Throwables in the chain.public static String getStackTrace(Throwable t)
t - スタックトレースを取得する対象となる Throwable.
Throwable.printStackTrace(PrintWriter) メソッドにて生成された
スタックトレース
printStackTrace(PrintWriter) method.public static String[] getStackFrames(Throwable t)
Throwable に関連するスタックトレースを取得し、
スタックフレームの配列に分解します。
Throwable object, decomposing it into a list of
stack frames.
t - スタックフレームを取得する対象となる Throwable.
Throwable.static String[] getStackFrames(String stackTrace)
getStackFrames(Throwable) メソッドと
NestableDelegate
クラスにて使用される機能。
getStackFrames(Throwable) methods of this and the
{@link org.apache.commons.lang.exception.NestableDelegate}
classes.
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||