Class IgnoreTopLevelConverterNotFoundBindHandler
- java.lang.Object
- org.springframework.boot.context.properties.bind.AbstractBindHandler
- org.springframework.boot.context.properties.bind.handler.IgnoreTopLevelConverterNotFoundBindHandler
- All Implemented Interfaces:
BindHandler
public class IgnoreTopLevelConverterNotFoundBindHandler extends AbstractBindHandler
BindHandler
that can be used to ignore top-levelConverterNotFoundException
s.- Since:
- 2.0.1
Field Summary
Fields inherited from interface org.springframework.boot.context.properties.bind.BindHandler
DEFAULT
Constructor Summary
Constructors Constructor Description IgnoreTopLevelConverterNotFoundBindHandler()
Create a newIgnoreTopLevelConverterNotFoundBindHandler
instance.IgnoreTopLevelConverterNotFoundBindHandler(BindHandler parent)
Create a newIgnoreTopLevelConverterNotFoundBindHandler
instance with a specific parent.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
onFailure(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Exception error)
Called when binding fails for any reason (including failures fromBindHandler.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)
calls).Methods inherited from class org.springframework.boot.context.properties.bind.AbstractBindHandler
onFinish, onStart, onSuccess
Constructor Detail
IgnoreTopLevelConverterNotFoundBindHandler
public IgnoreTopLevelConverterNotFoundBindHandler()
Create a newIgnoreTopLevelConverterNotFoundBindHandler
instance.
IgnoreTopLevelConverterNotFoundBindHandler
public IgnoreTopLevelConverterNotFoundBindHandler(BindHandler parent)
Create a newIgnoreTopLevelConverterNotFoundBindHandler
instance with a specific parent.- Parameters:
parent
- the parent handler
Method Detail
onFailure
public Object onFailure(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Exception error) throws Exception
Description copied from interface:BindHandler
Called when binding fails for any reason (including failures fromBindHandler.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)
calls). Implementations may choose to swallow exceptions and return an alternative result.- Specified by:
onFailure
in interfaceBindHandler
- Overrides:
onFailure
in classAbstractBindHandler
- Parameters:
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)- Returns:
- the actual result that should be used (may be
null
). - Throws:
Exception
- if the binding isn't valid