Class InitBinderDataBinderFactory
java.lang.Object
org.springframework.web.bind.support.DefaultDataBinderFactory
org.springframework.web.method.annotation.InitBinderDataBinderFactory
- All Implemented Interfaces:
webDataBinderFactory
- Direct Known Subclasses:
ServletRequestDataBinderFactory
Adds initialization to a webDataBinder via
@InitBinder methods.- Since:
- 3.1
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorsConstructorDescriptionInitBinderDataBinderFactory(@Nullable List<InvocableHandlerMethod> binderMethods, @Nullable webBindingInitializer initializer) Create a new InitBinderDataBinderFactory instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidinitBinder(webDataBinder dataBinder, NativewebRequest request) Initialize a webDataBinder with@InitBindermethods.protected booleanisBinderMethodApplicable(HandlerMethod initBinderMethod, webDataBinder dataBinder) Determine whether the given@InitBindermethod should be used to initialize the givenwebDataBinderinstance.Methods inherited from class DefaultDataBinderFactory
createBinder, createBinder, createBinderInstance, setMethodValidationApplicable
-
Constructor Details
-
InitBinderDataBinderFactory
public InitBinderDataBinderFactory(@Nullable List<InvocableHandlerMethod> binderMethods, @Nullable webBindingInitializer initializer) Create a new InitBinderDataBinderFactory instance.- Parameters:
binderMethods-@InitBindermethodsinitializer- for global data binder initialization
-
-
Method Details
-
initBinder
Initialize a webDataBinder with@InitBindermethods.If the
@InitBinderannotation specifies attributes names, it is invoked only if the names include the target object name.- Overrides:
initBinderin classDefaultDataBinderFactory- Parameters:
dataBinder- the data binder instance to customizerequest- the current request- Throws:
Exception- if one of the invoked @InitBindermethods fails- See Also:
-
isBinderMethodApplicable
protected boolean isBinderMethodApplicable(HandlerMethod initBinderMethod, webDataBinder dataBinder) Determine whether the given@InitBindermethod should be used to initialize the givenwebDataBinderinstance. By default we check the specified attribute names in the annotation value, if any.
-