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 binder,
NativeWebRequest request)
Initialize a WebDataBinder with
@InitBinder methods. |
protected boolean |
isBinderMethodApplicable(HandlerMethod initBinderMethod,
WebDataBinder binder)
Whether the given
@InitBinder method should be used to initialize
the given WebDataBinder instance. |
createBinder, createBinderInstance
public InitBinderDataBinderFactory(java.util.List<InvocableHandlerMethod> binderMethods, WebBindingInitializer initializer)
binderMethods
- @InitBinder
methodsinitializer
- for global data binder initializationpublic void initBinder(WebDataBinder binder, 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
binder
- the data binder instance to customizerequest
- the current requestjava.lang.Exception
- if one of the invoked @InitBinder
methods fail.protected boolean isBinderMethodApplicable(HandlerMethod initBinderMethod, WebDataBinder binder)
@InitBinder
method should be used to initialize
the given WebDataBinder instance. By default we check the attributes
names of the annotation, if present.