public class ValidationBindHandler extends AbstractBindHandler
BindHandler
は、バインドされた結果に Validators
を適用します。DEFAULT
コンストラクターと説明 |
---|
ValidationBindHandler(BindHandler parent, Validator... validators) |
ValidationBindHandler(Validator... validators) |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
onCreate
public ValidationBindHandler(Validator... validators)
public ValidationBindHandler(BindHandler parent, Validator... validators)
public <T> Bindable<T> onStart(ConfigurationPropertyName name, Bindable<T> target, BindContext context)
BindHandler
BindHandler
の onStart
AbstractBindHandler
の onStart
T
- バインド可能なソース型 name
- バインドされている要素の名前 target
- バインドされているアイテム context
- バインドコンテキスト null
の場合があります)public ObjectSE onSuccess(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ObjectSE result)
BindHandler
BindHandler
の onSuccess
AbstractBindHandler
の onSuccess
name
- バインドされている要素の名前 target
- バインドされているアイテム context
- バインドコンテキスト result
- バインドされた結果 (非 null
)null
の場合があります)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
AbstractBindHandler
の onFailure
name
- バインドされている要素の名前 target
- バインドされているアイテム context
- バインドコンテキスト error
- エラーの原因 (例外が発生した場合、再スローされる可能性があります)null
の場合があります)。ExceptionSE
- バインディングが有効でない場合 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
AbstractBindHandler
の onFinish
name
- バインドされている要素の名前 target
- バインドされているアイテム context
- バインドコンテキスト result
- バインドされた結果 (null
の場合があります)ExceptionSE
- バインディングが有効でない場合