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
ConverterNotFoundExceptions.- Since:
- 2.0.1
- Author:
- Madhura Bhave
-
Field Summary
Fields inherited from interface org.springframework.boot.context.properties.bind.BindHandler
DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newIgnoreTopLevelConverterNotFoundBindHandlerinstance.Create a newIgnoreTopLevelConverterNotFoundBindHandlerinstance 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, onSuccessMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.context.properties.bind.BindHandler
onCreate
-
Constructor Details
-
IgnoreTopLevelConverterNotFoundBindHandler
public IgnoreTopLevelConverterNotFoundBindHandler()Create a newIgnoreTopLevelConverterNotFoundBindHandlerinstance. -
IgnoreTopLevelConverterNotFoundBindHandler
Create a newIgnoreTopLevelConverterNotFoundBindHandlerinstance 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:BindHandlerCalled 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:
onFailurein interfaceBindHandler- Overrides:
onFailurein 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
-