Class IgnoreTopLevelConverterNotFoundBindHandler
java.lang.Object
org.springframework.boot.context.properties.bind.AbstractBindHandler
org.springframework.boot.context.properties.bind.handler.IgnoreTopLevelConverterNotFoundBindHandler
- All Implemented Interfaces:
BindHandler
BindHandler
that can be used to ignore top-level
ConverterNotFoundException
s.- Since:
- 2.0.1
- Author:
- Madhura Bhave
-
Field Summary
Fields inherited from interface org.springframework.boot.context.properties.bind.BindHandler
DEFAULT
-
Constructor Summary
ConstructorDescriptionCreate a newIgnoreTopLevelConverterNotFoundBindHandler
instance.Create a newIgnoreTopLevelConverterNotFoundBindHandler
instance with a specific parent. -
Method Summary
Modifier and TypeMethodDescriptiononFailure
(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)
orBindHandler.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).Methods inherited from class org.springframework.boot.context.properties.bind.AbstractBindHandler
onFinish, onStart, onSuccess
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.boot.context.properties.bind.BindHandler
onCreate
-
Constructor Details
-
IgnoreTopLevelConverterNotFoundBindHandler
public IgnoreTopLevelConverterNotFoundBindHandler()Create a newIgnoreTopLevelConverterNotFoundBindHandler
instance. -
IgnoreTopLevelConverterNotFoundBindHandler
Create a newIgnoreTopLevelConverterNotFoundBindHandler
instance with a specific parent.- Parameters:
parent
- the parent handler
-
-
Method Details
-
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)
orBindHandler.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.- 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
-