Package org.appng.api
Class RequestDataBinder<T>
- java.lang.Object
-
- org.springframework.validation.DataBinder
-
- org.appng.api.RequestDataBinder<T>
-
- Type Parameters:
T
- The type to bind the data to.
- All Implemented Interfaces:
org.springframework.beans.PropertyEditorRegistry
,org.springframework.beans.TypeConverter
- Direct Known Subclasses:
FormDataBinder
public class RequestDataBinder<T> extends org.springframework.validation.DataBinder
ADataBinder
that uses aRequest
to bind its values to the target object.
This class is especially useful inside aWebservice
, as shown below:byte[] processRequest(Site site, Application application, Environment environment, Request request) throws BusinessException; RequestDataBinder
Also note the possibility to set a customrequestDataBinder = new RequestDataBinder (new Person(), request); Person person = requestDataBinder.bind(); // proceed with person } ConversionService
for the binder.- Author:
- Matthias Müller
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RequestDataBinder(T target)
RequestDataBinder(T target, Request request)
Constructs a newRequestDataBinder
using aDefaultConversionService
RequestDataBinder(T target, Request request, org.springframework.core.convert.ConversionService conversionService)
Constructs a newRequestDataBinder
using the givenConversionService
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addValue(org.springframework.beans.MutablePropertyValues mpvs, String name, List<?> values)
T
bind()
Performs the actual binding.-
Methods inherited from class org.springframework.validation.DataBinder
addCustomFormatter, addCustomFormatter, addCustomFormatter, addValidators, applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, convertIfNecessary, convertIfNecessary, createBeanPropertyBindingResult, createDirectFieldBindingResult, doBind, findCustomEditor, getAllowedFields, getAutoGrowCollectionLimit, getBindingErrorProcessor, getBindingResult, getConversionService, getDisallowedFields, getInternalBindingResult, getObjectName, getPropertyAccessor, getPropertyEditorRegistry, getRequiredFields, getSimpleTypeConverter, getTarget, getTypeConverter, getValidator, getValidators, initBeanPropertyAccess, initDirectFieldAccess, isAllowed, isAutoGrowNestedPaths, isIgnoreInvalidFields, isIgnoreUnknownFields, registerCustomEditor, registerCustomEditor, replaceValidators, setAllowedFields, setAutoGrowCollectionLimit, setAutoGrowNestedPaths, setBindingErrorProcessor, setConversionService, setDisallowedFields, setIgnoreInvalidFields, setIgnoreUnknownFields, setMessageCodesResolver, setRequiredFields, setValidator, validate, validate
-
-
-
-
Constructor Detail
-
RequestDataBinder
public RequestDataBinder(T target, Request request)
Constructs a newRequestDataBinder
using aDefaultConversionService
- Parameters:
target
- the target objectrequest
- theRequest
-
RequestDataBinder
public RequestDataBinder(T target, Request request, org.springframework.core.convert.ConversionService conversionService)
Constructs a newRequestDataBinder
using the givenConversionService
- Parameters:
target
- the target objectrequest
- theRequest
conversionService
- theConversionService
to use
-
RequestDataBinder
protected RequestDataBinder(T target)
-
-
Method Detail
-
bind
public T bind()
Performs the actual binding. ThereforeRequestContainer.getParameterNames()
andRequestContainer.getFormUploads()
is used.- Returns:
- the object where the binding has been applied to
-
-