public class InitBinderDataBinderFactory extends DefaultDataBinderFactory
@InitBinder
methods.Constructor and Description |
---|
InitBinderDataBinderFactory(java.util.List<InvocableHandlerMethod> binderMethods,
WebBindingInitializer initializer)
Create a new InitBinderDataBinderFactory instance.
|
Modifier and Type | Method and Description |
---|---|
void |
initBinder(WebDataBinder dataBinder,
NativeWebRequest request)
Initialize a WebDataBinder with
@InitBinder methods. |
protected boolean |
isBinderMethodApplicable(HandlerMethod initBinderMethod,
WebDataBinder dataBinder)
Determine whether the given
@InitBinder method should be used
to initialize the given WebDataBinder instance. |
createBinder, createBinderInstance
public InitBinderDataBinderFactory(@Nullable java.util.List<InvocableHandlerMethod> binderMethods, @Nullable WebBindingInitializer initializer)
binderMethods
- @InitBinder
methodsinitializer
- for global data binder initializationpublic void initBinder(WebDataBinder dataBinder, NativeWebRequest request) throws java.lang.Exception
@InitBinder
methods.
If the @InitBinder
annotation specifies attributes names,
it is invoked only if the names include the target object name.
initBinder
in class DefaultDataBinderFactory
dataBinder
- the data binder instance to customizerequest
- the current requestjava.lang.Exception
- if one of the invoked @InitBinder
methods failsisBinderMethodApplicable(org.springframework.web.method.HandlerMethod, org.springframework.web.bind.WebDataBinder)
protected boolean isBinderMethodApplicable(HandlerMethod initBinderMethod, WebDataBinder dataBinder)
@InitBinder
method should be used
to initialize the given WebDataBinder
instance. By default we
check the specified attribute names in the annotation value, if any.