クラス ExceptionMatcher
java.lang.ObjectSE
org.springframework.kafka.support.ExceptionMatcher
ネストされた原因内で一致する例外を識別するための、設定可能な例外マッチャー。マッチャーは 2 つの方法で設定できます。
- With an allow list, only the registered exception matches. This includes exceptions that extend from any registered exception or implement it if that's an interface.
- () deny list の場合、例外は登録済みの例外に含まれない場合にのみ一致します。ホワイトリストの場合、登録済みの例外のいずれかを継承または実装する例外は一致しません。
ThrowableSE のみがインスペクションされます。ネストされた原因も検索するには、traverseCauses を有効にする必要があります。- 導入:
- 4.0
- 作成者:
- Stephane Nicoll, Dave Syer, Gary Russell
ネストされたクラスの要約
ネストされたクラスコンストラクターの概要
コンストラクター修飾子コンストラクター説明ExceptionMatcher(CollectionSE<ClassSE<? extends ThrowableSE>> exceptionTypes, boolean shouldMatchIfFound) 例外のリストを含むインスタンスを作成します。protectedExceptionMatcher(MapSE<ClassSE<? extends ThrowableSE>, BooleanSE> entries, boolean matchIfNotFound, boolean traverseCauses) メソッドのサマリー
修飾子と型メソッド説明static ExceptionMatcher任意のExceptionSE に一致するがエラーには一致しないマッチャーを作成します。static ExceptionMatcher.Builder例外型の構成可能なリストにある例外のみに一致するマッチャーのビルダーを作成します。static ExceptionMatcher.Builder例外型の構成可能なリストに見つからない例外のみに一致するマッチャーのビルダーを作成します。protected MapSE<ClassSE<? extends ThrowableSE>, BooleanSE> booleanmatch(@Nullable ThrowableSE exception) 指定されたThrowableSE がこのインスタンスと一致するかどうかを指定します。voidsetTraverseCauses(boolean traverseCauses) この一致でネストされた原因を走査して一致する例外の存在を確認するかどうかを指定します。
コンストラクターの詳細
ExceptionMatcher
public ExceptionMatcher(CollectionSE<ClassSE<? extends ThrowableSE>> exceptionTypes, boolean shouldMatchIfFound) 例外リストを持つインスタンスを作成します。shouldMatchIfFoundパラメーターは、リスト内に例外が見つかった場合に何が起こるかを決定します。- パラメーター:
exceptionTypes- 登録の例外shouldMatchIfFound- match result if a candidate exception is found amongst the given list
ExceptionMatcher
protected ExceptionMatcher(MapSE<ClassSE<? extends ThrowableSE>, BooleanSE> entries, boolean matchIfNotFound, boolean traverseCauses)
メソッドの詳細
defaultMatcher
任意のExceptionSE に一致するがエラーには一致しないマッチャーを作成します。- 戻り値:
- a matcher that matches any exception, but not errors
forAllowList
例外型の構成可能なリストにある例外のみに一致するマッチャーのビルダーを作成します。- 戻り値:
- a
ExceptionMatcher.Builderthat configures an allowlist of exceptions
forDenyList
例外型の構成可能なリストに見つからない例外のみに一致するマッチャーのビルダーを作成します。- 戻り値:
- a
ExceptionMatcher.Builderthat configures a denylist of exceptions
setTraverseCauses
public void setTraverseCauses(boolean traverseCauses) この一致でネストされた原因を走査して一致する例外の存在を確認するかどうかを指定します。- パラメーター:
traverseCauses- whether to traverse causes
match
指定されたThrowableSE がこのインスタンスと一致するかどうかを指定します。- パラメーター:
exception- チェックする例外- 戻り値:
trueif this exception match this instance,falseotherwise
getEntries