类 DefaultDataBinderFactory
- java.lang.Object
- org.springframework.web.bind.support.DefaultDataBinderFactory
- 所有已实现的接口:
WebDataBinderFactory
- 直接已知子类:
InitBinderDataBinderFactory
public class DefaultDataBinderFactory extends Object implements WebDataBinderFactory
Create aWebRequestDataBinderinstance and initialize it with aWebBindingInitializer.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 DefaultDataBinderFactory(WebBindingInitializer initializer)Create a newDefaultDataBinderFactoryinstance.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 WebDataBindercreateBinder(NativeWebRequest webRequest, Object target, String objectName)Create a newWebDataBinderfor the given target object and initialize it through aWebBindingInitializer.protected WebDataBindercreateBinderInstance(Object target, String objectName, NativeWebRequest webRequest)Extension point to create the WebDataBinder instance.protected voidinitBinder(WebDataBinder dataBinder, NativeWebRequest webRequest)Extension point to further initialize the created data binder instance (e.g. with@InitBindermethods) after "global" initialization viaWebBindingInitializer.
构造器详细资料
DefaultDataBinderFactory
public DefaultDataBinderFactory(@Nullable WebBindingInitializer initializer)
Create a newDefaultDataBinderFactoryinstance.- 参数:
initializer- for global data binder initialization (ornullif none)
方法详细资料
createBinder
public final WebDataBinder createBinder(NativeWebRequest webRequest, @Nullable Object target, String objectName) throws Exception
Create a newWebDataBinderfor the given target object and initialize it through aWebBindingInitializer.- 指定者:
createBinder在接口中WebDataBinderFactory- 参数:
webRequest- the current requesttarget- the object to create a data binder for, ornullif creating a binder for a simple typeobjectName- the name of the target object- 返回:
- the created
WebDataBinderinstance, never null - 抛出:
Exception- in case of invalid state or arguments
createBinderInstance
protected WebDataBinder createBinderInstance(@Nullable Object target, String objectName, NativeWebRequest webRequest) throws Exception
Extension point to create the WebDataBinder instance. By default this isWebRequestDataBinder.- 参数:
target- the binding target ornullfor type conversion onlyobjectName- the binding target object namewebRequest- the current request- 抛出:
Exception- in case of invalid state or arguments
initBinder
protected void initBinder(WebDataBinder dataBinder, NativeWebRequest webRequest) throws Exception
Extension point to further initialize the created data binder instance (e.g. with@InitBindermethods) after "global" initialization viaWebBindingInitializer.- 参数:
dataBinder- the data binder instance to customizewebRequest- the current request- 抛出:
Exception- if initialization fails