org.apache.commons.lang.exception
インタフェース Nestable

既知の実装クラスの一覧:
NestableError, NestableException, NestableRuntimeException

public interface Nestable

Throwable の実装にルートとなる例外を 内部にネストして持つことができるように拡張を行うインターフェイスです。

An interface to be implemented by {@link java.lang.Throwable} extensions which would like to be able to nest root exceptions inside themselves.

バージョン:
$Id: Nestable.java,v 1.1.1.1 2004/02/13 10:02:04 hioki Exp $
作成者:
Daniel Rall, Kasper Nielsen, Steven Caswell
翻訳者:
日置 聡
翻訳状況:
初稿(校正者募集中)
翻訳更新日:
2003/08/06

メソッドの概要
 Throwable getCause()
          Nestable が実装された例外の原因となった例外またはエラーの参照を返します。
 String getMessage()
          この例外とネストされた Throwable のエラーメッセージを返します。
 String getMessage(int index)
          内部に保持されている Throwable のうち、0 から始まる指定されたインデックスに該当する Throwable のメッセージを返します。
 String[] getMessages()
          この例外と内部にネストされる Throwable のエラーメッセージをStringの配列に格納して返します。
 Throwable getThrowable(int index)
          内部に保持されている Throwable のうち、0 から始まる指定されたインデックスに該当する Throwable を返します。
 int getThrowableCount()
          この Nestable に含まれるネストされた Throwable の数を返します。
 Throwable[] getThrowables()
          この Nestable と、内部にネストされた ThrowableThrowable の配列に格納して返します。
 int indexOfThrowable(Class type)
          内部にネストされた Throwable の中から、最初に見つかった指定された型の 0 から始まるインデックスを返します。
 int indexOfThrowable(Class type, int fromIndex)
          内部にネストされた Throwable から、最初に見つかった指定された型の、検索開始位置より後ろの 0 から始まるインデックスを返します。
 void printPartialStackTrace(PrintWriter out)
          指定された writer に対してルートとなる(ネストされたものを含まない)例外のスタックトレースを出力します。
 void printStackTrace(PrintStream out)
          指定された print stream に対してこの例外のスタックトレースを出力します。
 void printStackTrace(PrintWriter out)
          指定された print writer に対してこの例外のスタックトレースを出力します。
 

メソッドの詳細

getCause

public Throwable getCause()
Nestable が実装された例外の原因となった例外またはエラーの参照を返します。
Returns the reference to the exception or error that caused the exception implementing the Nestable to be thrown.


getMessage

public String getMessage()
この例外とネストされた Throwable のエラーメッセージを返します。
Returns the error message of this and any nested Throwable.

戻り値:
エラーメッセージ
the error message

getMessage

public String getMessage(int index)
内部に保持されている Throwable のうち、0 から始まる指定されたインデックスに該当する Throwable のメッセージを返します。
Returns the error message of the Throwable in the chain of Throwables at the specified index, numbererd from 0.

パラメータ:
index - 内部に保持されている Throwable のインデックス
the index of the Throwable in the chain of Throwables
戻り値:
エラーメッセージ、インデックスで指定された Throwable にメッセージが設定されていない場合には null
the error message, or null if the Throwable at the specified index in the chain does not contain a message
例外:
IndexOutOfBoundsException - index の値がマイナスまたは内部の Throwable の数が指定された値よりも少ない場合
if the index argument is negative or not less than the count of Throwables in the chain

getMessages

public String[] getMessages()
この例外と内部にネストされる Throwable のエラーメッセージをStringの配列に格納して返します。 メッセージを持たない Throwable のメッセージは null で表現されます。 返される配列の長さは原因の数を示す getThrowableCount() の返す値と一致します。
Returns the error message of this and any nested Throwables in an array of Strings, one element for each message. Any Throwable not containing a message is represented in the array by a null. This has the effect of cause the length of the returned array to be equal to the result of the {@link #getThrowableCount()} operation.

戻り値:
エラーメッセージ
the error messages

getThrowable

public Throwable getThrowable(int index)
内部に保持されている Throwable のうち、0 から始まる指定されたインデックスに該当する Throwable を返します。
Returns the Throwable in the chain of Throwables at the specified index, numbererd from 0.

パラメータ:
index - 内部に保持される Throwable の 0 から始まるインデックス
the index, numbered from 0, of the Throwable in the chain of Throwables
戻り値:
該当する Throwable
the Throwable
例外:
IndexOutOfBoundsException - index の値がマイナスまたは内部の Throwable の数が指定された値よりも少ない場合
if the index argument is negative or not less than the count of Throwables in the chain

getThrowableCount

public int getThrowableCount()
この Nestable に含まれるネストされた Throwable の数を返します。
Returns the number of nested Throwables represented by this Nestable, including this Nestable.

戻り値:
スロー可能オブジェクト(throwable)の数
the throwable count

getThrowables

public Throwable[] getThrowables()
この Nestable と、内部にネストされた ThrowableThrowable の配列に格納して返します。
Returns this Nestable and any nested Throwables in an array of Throwables, one element for each Throwable.

戻り値:
Throwable の配列
the Throwables

indexOfThrowable

public int indexOfThrowable(Class type)
内部にネストされた Throwable の中から、最初に見つかった指定された型の 0 から始まるインデックスを返します。 該当するものが見つからなかった場合には -1 を返します。
Returns the index, numbered from 0, of the first occurrence of the specified type in the chain of Throwable Throwables, or -1 if the specified type is not found in the chain.

パラメータ:
type - 検索対象となる Class
type Class to be found
戻り値:
指定された型が最初に見つかったインデックス、見つからなかった場合には -1
index of the first occurrence of the type in the chain, or -1 if the type is not found

indexOfThrowable

public int indexOfThrowable(Class type,
                            int fromIndex)
内部にネストされた Throwable から、最初に見つかった指定された型の、検索開始位置より後ろの 0 から始まるインデックスを返します。 該当するものが見つからなかった場合には -1 を返します。
Returns the index, numbered from 0, of the first Throwable that matches the specified type in the chain of Throwables with an index greater than or equal to the specified index, or -1 if the type is not found.

パラメータ:
type - 検索対象となる Class
type Class to be found
fromIndex - 検索の開始位置となる 0 から始まるインデックス
the index, numbered from 0, of the starting position in the chain to be searched
戻り値:
指定された型が最初に見つかったインデックス、見つからなかった場合には -1
index of the first occurrence of the type in the chain, or -1 if the type is not found
例外:
IndexOutOfBoundsException - fromIndexの値がマイナスまたは内部の Throwable の数が指定された値よりも少ない場合
if the fromIndex argument is negative or not less than the count of Throwables in the chain

printStackTrace

public void printStackTrace(PrintWriter out)
指定された print writer に対してこの例外のスタックトレースを出力します。 この例外の原因(となる例外)がある場合にはその情報も出力されます。
Prints the stack trace of this exception to the specified print writer. Includes inforamation from the exception--if any--which caused this exception.

パラメータ:
out - 出力に使用される PrintWriter
PrintWriter to use for output.

printStackTrace

public void printStackTrace(PrintStream out)
指定された print stream に対してこの例外のスタックトレースを出力します。 この例外の原因(となる例外)がある場合にはその情報も出力されます。
Prints the stack trace of this exception to the specified print stream. Includes inforamation from the exception--if any--which caused this exception.

パラメータ:
out - 出力に使用される PrintStream
PrintStream to use for output.

printPartialStackTrace

public void printPartialStackTrace(PrintWriter out)
指定された writer に対してルートとなる(ネストされたものを含まない)例外のスタックトレースを出力します。 NestableDelegate から、個々のスタックトレースをバッファに出力するために使用されます。 このメソッドの実装は大体の場合 super.printStackTrace(out); を呼ぶべきです。
Prints the stack trace for this exception only--root cause not included--using the provided writer. Used by {@link org.apache.commons.lang.exception.NestableDelegate} to write individual stack traces to a buffer. The implementation of this method should call super.printStackTrace(out); in most cases.

パラメータ:
out - 使用される writer
The writer to use.


このドキュメントは、Ja-Jakartaにより訳されました。 コメントがある場合は report@jajakarta.orgまでお願いします。
Translated into Japanese by jajakarta.org. The original page is here.
Copyright (c) 2002-2003 - Apache Software Foundation