クラス AbstractBindHandler
java.lang.ObjectSE
org.springframework.boot.context.properties.bind.AbstractBindHandler
- 実装されたすべてのインターフェース:
BindHandler
- 既知の直属サブクラス
BoundPropertiesTrackingBindHandler
、IgnoreErrorsBindHandler
、IgnoreTopLevelConverterNotFoundBindHandler
、NoUnboundElementsBindHandler
、ValidationBindHandler
BindHandler
実装の抽象基本クラス。- 導入:
- 2.0.0
- 作成者:
- Phillip Webb, Madhura Bhave
フィールドサマリー
インターフェース org.springframework.boot.context.properties.bind.BindHandler から継承されたフィールド
DEFAULT
コンストラクターのサマリー
コンストラクター説明新しいバインディングハンドラーインスタンスを作成します。AbstractBindHandler
(BindHandler parent) 特定の親を持つ新しいバインディングハンドラーインスタンスを作成します。メソッドのサマリー
修飾子と型メソッド説明onFailure
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ExceptionSE error) バインドが何らかの理由で失敗した場合に呼び出されます(BindHandler.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)
またはBindHandler.onCreate(org.springframework.boot.context.properties.source.ConfigurationPropertyName, org.springframework.boot.context.properties.bind.Bindable<?>, org.springframework.boot.context.properties.bind.BindContext, java.lang.Object)
呼び出しからの失敗を含む)。void
onFinish
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ObjectSE result) バインドがバインド済みまたはバインドなしの結果で終了したときに呼び出されます。<T> Bindable<T>
onStart
(ConfigurationPropertyName name, Bindable<T> target, BindContext context) 要素のバインドが開始されたときに、結果が決定される前に呼び出されます。onSuccess
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ObjectSE result) 要素のバインディングが成功した結果で終了すると呼び出されます。クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.boot.context.properties.bind.BindHandler から継承されたメソッド
onCreate
コンストラクターの詳細
AbstractBindHandler
public AbstractBindHandler()新しいバインディングハンドラーインスタンスを作成します。AbstractBindHandler
特定の親を持つ新しいバインディングハンドラーインスタンスを作成します。- パラメーター:
parent
- 親ハンドラー
メソッドの詳細
onStart
public <T> Bindable<T> onStart(ConfigurationPropertyName name, Bindable<T> target, BindContext context) インターフェースからコピーされた説明:BindHandler
要素のバインドが開始されたときに、結果が決定される前に呼び出されます。- 次で指定:
- インターフェース
BindHandler
のonStart
- 型パラメーター:
T
- バインド可能なソース型- パラメーター:
name
- バインドされている要素の名前target
- バインドされているアイテムcontext
- バインドコンテキスト- 戻り値:
- バインドに使用される実際のアイテム (
null
の場合があります)
onSuccess
public ObjectSE onSuccess(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ObjectSE result) インターフェースからコピーされた説明:BindHandler
要素のバインディングが成功した結果で終了すると呼び出されます。実装は、最終的に返される結果を変更したり、追加検証を実行したりする場合があります。- 次で指定:
- インターフェース
BindHandler
のonSuccess
- パラメーター:
name
- バインドされている要素の名前target
- バインドされているアイテムcontext
- バインドコンテキストresult
- バインドされた結果 (非null
)- 戻り値:
- 使用すべき実際の結果 (
null
の場合があります)
onFailure
public ObjectSE onFailure(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ExceptionSE error) throws ExceptionSE インターフェースからコピーされた説明:BindHandler
バインドが何らかの理由で失敗した場合に呼び出されます(BindHandler.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)
またはBindHandler.onCreate(org.springframework.boot.context.properties.source.ConfigurationPropertyName, org.springframework.boot.context.properties.bind.Bindable<?>, org.springframework.boot.context.properties.bind.BindContext, java.lang.Object)
呼び出しからの失敗を含む)。実装は、例外を飲み込み、代替結果を返すことを選択できます。- 次で指定:
- インターフェース
BindHandler
のonFailure
- パラメーター:
name
- バインドされている要素の名前target
- バインドされているアイテムcontext
- バインドコンテキストerror
- エラーの原因 (例外が発生した場合、再スローされる可能性があります)- 戻り値:
- 使用すべき実際の結果(
null
の場合があります)。 - 例外:
ExceptionSE
- バインディングが有効でない場合
onFinish
public void onFinish(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ObjectSE result) throws ExceptionSE インターフェースからコピーされた説明:BindHandler
バインドがバインド済みまたはバインドなしの結果で終了したときに呼び出されます。ハンドラーがBindHandler.onFailure(org.springframework.boot.context.properties.source.ConfigurationPropertyName, org.springframework.boot.context.properties.bind.Bindable<?>, org.springframework.boot.context.properties.bind.BindContext, java.lang.Exception)
から結果を返したとしても、バインディングが失敗した場合、このメソッドは呼び出されません。- 次で指定:
- インターフェース
BindHandler
のonFinish
- パラメーター:
name
- バインドされている要素の名前target
- バインドされているアイテムcontext
- バインドコンテキストresult
- バインドされた結果 (null
の場合があります)- 例外:
ExceptionSE
- バインディングが有効でない場合