类 WebExchangeDataBinder
- java.lang.Object
- org.springframework.validation.DataBinder
- org.springframework.web.bind.WebDataBinder
- org.springframework.web.bind.support.WebExchangeDataBinder
- 所有已实现的接口:
PropertyEditorRegistry
,TypeConverter
public class WebExchangeDataBinder extends WebDataBinder
SpecializedDataBinder
to perform data binding from URL query params or form data in the request data to Java objects.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.web.bind.WebDataBinder
DEFAULT_FIELD_DEFAULT_PREFIX, DEFAULT_FIELD_MARKER_PREFIX
从类继承的字段 org.springframework.validation.DataBinder
DEFAULT_AUTO_GROW_COLLECTION_LIMIT, DEFAULT_OBJECT_NAME, logger
构造器概要
构造器 构造器 说明 WebExchangeDataBinder(Object target)
Create a new instance, with default object name.WebExchangeDataBinder(Object target, String objectName)
Create a new instance.
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 reactor.core.publisher.Mono<Void>
bind(ServerWebExchange exchange)
Bind query params, form data, and or multipart form data to the binder target.static reactor.core.publisher.Mono<Map<String,Object>>
extractValuesToBind(ServerWebExchange exchange)
Combine query params and form data for multipart form data from the body of the request into aMap<String, Object>
of values to use for data binding purposes.protected reactor.core.publisher.Mono<Map<String,Object>>
getValuesToBind(ServerWebExchange exchange)
Protected method to obtain the values for data binding.从类继承的方法 org.springframework.web.bind.WebDataBinder
bindMultipart, checkFieldDefaults, checkFieldMarkers, doBind, getEmptyValue, getEmptyValue, getFieldDefaultPrefix, getFieldMarkerPrefix, isBindEmptyMultipartFiles, setBindEmptyMultipartFiles, setFieldDefaultPrefix, setFieldMarkerPrefix
从类继承的方法 org.springframework.validation.DataBinder
addCustomFormatter, addCustomFormatter, addCustomFormatter, addValidators, applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, 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
构造器详细资料
WebExchangeDataBinder
public WebExchangeDataBinder(@Nullable Object target)
Create a new instance, with default object name.- 参数:
target
- the target object to bind onto (ornull
if the binder is just used to convert a plain parameter value)- 另请参阅:
DataBinder.DEFAULT_OBJECT_NAME
WebExchangeDataBinder
public WebExchangeDataBinder(@Nullable Object target, String objectName)
Create a new instance.- 参数:
target
- the target object to bind onto (ornull
if the binder is just used to convert a plain parameter value)objectName
- the name of the target object
方法详细资料
bind
public reactor.core.publisher.Mono<Void> bind(ServerWebExchange exchange)
Bind query params, form data, and or multipart form data to the binder target.- 参数:
exchange
- the current exchange- 返回:
- a
Mono<Void>
when binding is complete
getValuesToBind
protected reactor.core.publisher.Mono<Map<String,Object>> getValuesToBind(ServerWebExchange exchange)
Protected method to obtain the values for data binding. By default this method delegates toextractValuesToBind(ServerWebExchange)
.
extractValuesToBind
public static reactor.core.publisher.Mono<Map<String,Object>> extractValuesToBind(ServerWebExchange exchange)
Combine query params and form data for multipart form data from the body of the request into aMap<String, Object>
of values to use for data binding purposes.- 参数:
exchange
- the current exchange- 返回:
- a
Mono
with the values to bind - 另请参阅:
ServerHttpRequest.getQueryParams()
,ServerWebExchange.getFormData()
,ServerWebExchange.getMultipartData()