public class WebExchangeDataBinder extends WebDataBinder
DataBinder
to perform data
binding from URL query params or form data in the request data to Java objects.DEFAULT_FIELD_DEFAULT_PREFIX, DEFAULT_FIELD_MARKER_PREFIX
DEFAULT_AUTO_GROW_COLLECTION_LIMIT, DEFAULT_OBJECT_NAME, logger
Constructor and Description |
---|
WebExchangeDataBinder(java.lang.Object target)
Create a new instance, with default object name.
|
WebExchangeDataBinder(java.lang.Object target,
java.lang.String objectName)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
<any> |
bind(ServerWebExchange exchange)
Bind the URL query parameters or form data of the body of the given request
to this binder's target.
|
protected java.util.Map<java.lang.String,?> |
getExtraValuesToBind(ServerWebExchange exchange)
Extension point that subclasses can use to add extra bind values for a
request.
|
protected java.util.Map<java.lang.String,java.util.List<MultipartFile>> |
getMultipartFiles(ServerWebExchange exchange)
Bind all multipart files contained in the given request, if any (in case
of a multipart request).
|
private java.util.Map<java.lang.String,java.lang.Object> |
getParamsToBind(MultiValueMap<java.lang.String,java.lang.String> params) |
bindMultipart, checkFieldDefaults, checkFieldMarkers, doBind, getEmptyValue, getFieldDefaultPrefix, getFieldMarkerPrefix, isBindEmptyMultipartFiles, setBindEmptyMultipartFiles, setFieldDefaultPrefix, setFieldMarkerPrefix
addCustomFormatter, addCustomFormatter, addCustomFormatter, addValidators, applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, convertIfNecessary, createBeanPropertyBindingResult, createDirectFieldBindingResult, 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
public WebExchangeDataBinder(java.lang.Object target)
target
- the target object to bind onto (or null
if the
binder is just used to convert a plain parameter value)DataBinder.DEFAULT_OBJECT_NAME
public WebExchangeDataBinder(java.lang.Object target, java.lang.String objectName)
target
- the target object to bind onto (or null
if the
binder is just used to convert a plain parameter value)objectName
- the name of the target objectpublic <any> bind(ServerWebExchange exchange)
"application/x-www-form-urlencoded"
.exchange
- the current exchange.Mono<Void>
when binding is completeprivate java.util.Map<java.lang.String,java.lang.Object> getParamsToBind(MultiValueMap<java.lang.String,java.lang.String> params)
protected java.util.Map<java.lang.String,java.util.List<MultipartFile>> getMultipartFiles(ServerWebExchange exchange)
Multipart files will only be added to the property values if they are not empty or if we're configured to bind empty multipart files too.
exchange
- the current exchangeprotected java.util.Map<java.lang.String,?> getExtraValuesToBind(ServerWebExchange exchange)
WebDataBinder.doBind(MutablePropertyValues)
.
The default implementation is empty.exchange
- the current exchange