|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.apache.commons.lang.exception.ExceptionUtils
Throwable オブジェクトを処理するためのユーティリティルーチンです。
| フィールドの概要 | |
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 を生成します。インスタンス化を制限します。
| メソッドの詳細 |
public static Throwable getCause(Throwable t)
Throwable の Throwable オブジェクトを返す(標準の JDK 1.4 と
NestableException のAPIの)
getCause()、 getNextException()、
getTargetException()、 getException() メソッド
を利用して原因となる例外を抽出し、返します。
上記のものが見つからない場合 null を返します。
t - 内部にある原因となる例外
Throwable
public static Throwable getCause(Throwable t,
String[] methodNames)
getCause(Throwable) を指定されたメソッドのみを使用するように拡張します。
getCause(Throwable)public static Throwable getRootCause(Throwable t)
getCause(Throwable) を使用して内部の例外をたどり、
根本の原因(root)となる例外を返します。
Throwable.
getCause(Throwable)private static Throwable getCauseUsingWellKnownTypes(Throwable t)
instanceof のチェックを行い
内部にネストされた例外を持ちうる想定された型であった場合、その内部の例外を返します。
t - 調査対象となる例外
null
private static Throwable getCauseUsingMethodName(Throwable t,
String methodName)
t - 調査対象となる例外
methodName - 検索し、実行するメソッド名
null
private static Throwable getCauseUsingFieldName(Throwable t,
String fieldName)
t - 調査対象となる例外
fieldName - 調査対象となる属性(フィールド)名
null
public static int getThrowableCount(Throwable t)
Throwable オブジェクトの数を返します。
t - 調査対象となる例外
public static Throwable[] getThrowables(Throwable t)
Throwable オブジェクトを配列に格納し返します。
t - 調査対象となる例外
Throwable オブジェクトの配列。
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 を返します。
t - 調査対象となる例外
type - 検索対象となる Class
fromIndex - 検索を開始する位置となる0から始まるインデックス
-1
IndexOutOfBoundsException - fromIndex がマイナスだった場合
または内部に含まれる Throwable の数より大きかった場合
public static String getStackTrace(Throwable t)
t - スタックトレースを取得する対象となる Throwable.
printStackTrace(PrintWriter) メソッドにて生成された
スタックトレース
public static String[] getStackFrames(Throwable t)
Throwable に関連するスタックトレースを取得し、
スタックフレームの配列に分解します。
t - スタックフレームを取得する対象となる Throwable.
static String[] getStackFrames(String stackTrace)
getStackFrames(Throwable) メソッドと
NestableDelegate
クラスにて使用される機能。
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||