public class NoUnboundElementsBindHandler extends AbstractBindHandler
BindHandler
to enforce that all configuration properties under the root name
have been bound.DEFAULT
Constructor and Description |
---|
NoUnboundElementsBindHandler(BindHandler parent) |
NoUnboundElementsBindHandler(BindHandler parent,
Function<ConfigurationPropertySource,Boolean> filter) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onCreate
public NoUnboundElementsBindHandler(BindHandler parent)
public NoUnboundElementsBindHandler(BindHandler parent, Function<ConfigurationPropertySource,Boolean> filter)
public <T> Bindable<T> onStart(ConfigurationPropertyName name, Bindable<T> target, BindContext context)
BindHandler
onStart
in interface BindHandler
onStart
in class AbstractBindHandler
T
- the bindable source typename
- the name of the element being boundtarget
- the item being boundcontext
- the bind contextnull
)public Object onSuccess(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result)
BindHandler
onSuccess
in interface BindHandler
onSuccess
in class AbstractBindHandler
name
- the name of the element being boundtarget
- the item being boundcontext
- the bind contextresult
- the bound result (never null
)null
)public Object onFailure(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Exception error) throws Exception
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)
or 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)
calls). Implementations may choose to
swallow exceptions and return an alternative result.onFailure
in interface BindHandler
onFailure
in class AbstractBindHandler
name
- the name of the element being boundtarget
- the item being boundcontext
- the bind contexterror
- the cause of the error (if the exception stands it may be re-thrown)null
).Exception
- if the binding isn't validpublic void onFinish(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result) throws Exception
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)
.onFinish
in interface BindHandler
onFinish
in class AbstractBindHandler
name
- the name of the element being boundtarget
- the item being boundcontext
- the bind contextresult
- the bound result (may be null
)Exception
- if the binding isn't valid