类 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@InitBindermethods.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 InitBinderDataBinderFactory(List<InvocableHandlerMethod> binderMethods, WebBindingInitializer initializer)Create a new InitBinderDataBinderFactory instance.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidinitBinder(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.从类继承的方法 org.springframework.web.bind.support.DefaultDataBinderFactory
createBinder, createBinderInstance
构造器详细资料
InitBinderDataBinderFactory
public InitBinderDataBinderFactory(List<InvocableHandlerMethod> binderMethods, WebBindingInitializer initializer)
Create a new InitBinderDataBinderFactory instance.- 参数:
binderMethods-@InitBindermethodsinitializer- for global data binder initialization
方法详细资料
initBinder
public void initBinder(WebDataBinder dataBinder, NativeWebRequest request) throws Exception
Initialize a WebDataBinder with@InitBindermethods.If the
@InitBinderannotation 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 @InitBindermethods fails- 另请参阅:
isBinderMethodApplicable(org.springframework.web.method.HandlerMethod, org.springframework.web.bind.WebDataBinder)
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.