类 DefaultDataBinderFactory
- java.lang.Object
- org.springframework.web.bind.support.DefaultDataBinderFactory
- 所有已实现的接口:
WebDataBinderFactory
- 直接已知子类:
InitBinderDataBinderFactory
public class DefaultDataBinderFactory extends Object implements WebDataBinderFactory
Create aWebRequestDataBinder
instance and initialize it with aWebBindingInitializer
.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 DefaultDataBinderFactory(WebBindingInitializer initializer)
Create a newDefaultDataBinderFactory
instance.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 WebDataBinder
createBinder(NativeWebRequest webRequest, Object target, String objectName)
Create a newWebDataBinder
for the given target object and initialize it through aWebBindingInitializer
.protected WebDataBinder
createBinderInstance(Object target, String objectName, NativeWebRequest webRequest)
Extension point to create the WebDataBinder instance.protected void
initBinder(WebDataBinder dataBinder, NativeWebRequest webRequest)
Extension point to further initialize the created data binder instance (e.g. with@InitBinder
methods) after "global" initialization viaWebBindingInitializer
.
构造器详细资料
DefaultDataBinderFactory
public DefaultDataBinderFactory(@Nullable WebBindingInitializer initializer)
Create a newDefaultDataBinderFactory
instance.- 参数:
initializer
- for global data binder initialization (ornull
if none)
方法详细资料
createBinder
public final WebDataBinder createBinder(NativeWebRequest webRequest, @Nullable Object target, String objectName) throws Exception
Create a newWebDataBinder
for the given target object and initialize it through aWebBindingInitializer
.- 指定者:
createBinder
在接口中WebDataBinderFactory
- 参数:
webRequest
- the current requesttarget
- the object to create a data binder for, ornull
if creating a binder for a simple typeobjectName
- the name of the target object- 返回:
- the created
WebDataBinder
instance, 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 ornull
for 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@InitBinder
methods) after "global" initialization viaWebBindingInitializer
.- 参数:
dataBinder
- the data binder instance to customizewebRequest
- the current request- 抛出:
Exception
- if initialization fails