public class DefaultDataBinderFactory extends java.lang.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,
java.lang.Object target,
java.lang.String objectName)
Create a new
WebDataBinder for the given target object and
initialize it through a WebBindingInitializer . |
protected WebDataBinder |
createBinderInstance(java.lang.Object target,
java.lang.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 java.lang.Object target, java.lang.String objectName) throws java.lang.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 nulljava.lang.Exception
- in case of invalid state or argumentsprotected WebDataBinder createBinderInstance(@Nullable java.lang.Object target, java.lang.String objectName, NativeWebRequest webRequest) throws java.lang.Exception
WebRequestDataBinder
.target
- the binding target or null
for type conversion onlyobjectName
- the binding target object namewebRequest
- the current requestjava.lang.Exception
- in case of invalid state or argumentsprotected void initBinder(WebDataBinder dataBinder, NativeWebRequest webRequest) throws java.lang.Exception
@InitBinder
methods) after "global" initialization
via WebBindingInitializer
.dataBinder
- the data binder instance to customizewebRequest
- the current requestjava.lang.Exception
- if initialization fails