类 InitBinderDataBinderFactory
- java.lang.Object
- org.springframework.web.bind.support.DefaultDataBinderFactory
- org.springframework.web.method.annotation.InitBinderDataBinderFactory
- 所有已实现的接口:
WebDataBinderFactory
public class InitBinderDataBinderFactory extends DefaultDataBinderFactory
Adds initialization to a WebDataBinder via@InitBinder
methods.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 InitBinderDataBinderFactory(List<InvocableHandlerMethod> binderMethods, WebBindingInitializer initializer)
Create a new InitBinderDataBinderFactory instance.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 givenWebDataBinder
instance.从类继承的方法 org.springframework.web.bind.support.DefaultDataBinderFactory
createBinder, createBinderInstance
构造器详细资料
InitBinderDataBinderFactory
public InitBinderDataBinderFactory(List<InvocableHandlerMethod> binderMethods, WebBindingInitializer initializer)
Create a new InitBinderDataBinderFactory instance.- 参数:
binderMethods
-@InitBinder
methodsinitializer
- for global data binder initialization
方法详细资料
initBinder
public void initBinder(WebDataBinder dataBinder, NativeWebRequest request) throws Exception
Initialize a WebDataBinder with@InitBinder
methods.If the
@InitBinder
annotation specifies attributes names, it is invoked only if the names include the target object name.- 覆盖:
initBinder
在类中DefaultDataBinderFactory
- 参数:
dataBinder
- the data binder instance to customizerequest
- the current request- 抛出:
Exception
- if one of the invoked @InitBinder
methods fails- 另请参阅:
isBinderMethodApplicable(org.springframework.web.method.HandlerMethod, org.springframework.web.bind.WebDataBinder)
isBinderMethodApplicable
protected boolean isBinderMethodApplicable(HandlerMethod initBinderMethod, WebDataBinder dataBinder)
Determine whether the given@InitBinder
method should be used to initialize the givenWebDataBinder
instance. By default we check the specified attribute names in the annotation value, if any.