public interface BindHandler
binding
中に追加のロジックを処理するために使用できるコールバックインターフェース。修飾子と型 | フィールドと説明 |
---|---|
static BindHandler | DEFAULT デフォルトの no-op バインドハンドラー。 |
修飾子と型 | メソッドと説明 |
---|---|
default ObjectSE | onFailure(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ExceptionSE error) |
default void | onFinish(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ObjectSE result) プロパティがバインドされたかどうかに関係なく、バインドが終了したときに呼び出されます。 |
default <T> Bindable<T> | onStart(ConfigurationPropertyName name, Bindable<T> target, BindContext context) 要素のバインドが開始されたときに、結果が決定される前に呼び出されます。 |
default ObjectSE | onSuccess(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ObjectSE result) 要素のバインディングが成功した結果で終了すると呼び出されます。 |
static final BindHandler DEFAULT
default <T> Bindable<T> onStart(ConfigurationPropertyName name, Bindable<T> target, BindContext context)
T
- バインド可能なソース型 name
- バインドされている要素の名前 target
- バインドされているアイテム context
- バインドコンテキスト null
の場合があります)default ObjectSE onSuccess(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ObjectSE result)
name
- バインドされている要素の名前 target
- バインドされているアイテム context
- バインドコンテキスト result
- バインドされた結果 (非 null
)null
の場合があります)default ObjectSE onFailure(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ExceptionSE error) throws ExceptionSE
onSuccess(org.springframework.boot.context.properties.source.ConfigurationPropertyName, org.springframework.boot.context.properties.bind.Bindable<?>, org.springframework.boot.context.properties.bind.BindContext, java.lang.Object)
呼び出しによる失敗を含む)でバインディングが失敗したときに呼び出されます。実装は、例外を飲み込んで別の結果を返すことを選択できます。name
- バインドされている要素の名前 target
- バインドされているアイテム context
- バインドコンテキスト error
- エラーの原因 (例外が発生した場合、再スローされる可能性があります)null
の場合があります)。ExceptionSE
- バインディングが有効でない場合 default void onFinish(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ObjectSE result) throws ExceptionSE
name
- バインドされている要素の名前 target
- バインドされているアイテム context
- バインドコンテキスト result
- バインドされた結果 (null
の場合があります)ExceptionSE
- バインディングが有効でない場合 Copyright © 2019 Pivotal Software, Inc.. All rights reserved.