public class DefaultDataBinderFactory extends Object implements WebDataBinderFactory
WebRequestDataBinder
instance and initialize it with a
WebBindingInitializer
.Constructor and Description |
---|
DefaultDataBinderFactory(WebBindingInitializer initializer)
Create a new
DefaultDataBinderFactory instance. |
Modifier and Type | Method and Description |
---|---|
WebDataBinder |
createBinder(NativeWebRequest webRequest,
Object target,
String objectName)
Create a new
WebDataBinder for the given target object and
initialize it through a WebBindingInitializer . |
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.
|
public DefaultDataBinderFactory(@Nullable WebBindingInitializer initializer)
DefaultDataBinderFactory
instance.initializer
- for global data binder initialization
(or null
if none)public final WebDataBinder createBinder(NativeWebRequest webRequest, @Nullable Object target, String objectName) throws Exception
WebDataBinder
for the given target object and
initialize it through a WebBindingInitializer
.createBinder
in interface WebDataBinderFactory
webRequest
- the current requesttarget
- the object to create a data binder for,
or null
if creating a binder for a simple typeobjectName
- the name of the target objectWebDataBinder
instance, never nullException
- in case of invalid state or argumentsprotected WebDataBinder createBinderInstance(@Nullable Object target, String objectName, NativeWebRequest webRequest) throws Exception
WebRequestDataBinder
.target
- the binding target or null
for type conversion onlyobjectName
- the binding target object namewebRequest
- the current requestException
- in case of invalid state or argumentsprotected void initBinder(WebDataBinder dataBinder, NativeWebRequest webRequest) throws Exception
@InitBinder
methods) after "global" initialization
via WebBindingInitializer
.dataBinder
- the data binder instance to customizewebRequest
- the current requestException
- if initialization fails