类 AbstractMessageReaderArgumentResolver
- java.lang.Object
- org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
- org.springframework.web.reactive.result.method.annotation.AbstractMessageReaderArgumentResolver
- 所有已实现的接口:
HandlerMethodArgumentResolver
- 直接已知子类:
HttpEntityMethodArgumentResolver
,RequestBodyMethodArgumentResolver
,RequestPartMethodArgumentResolver
public abstract class AbstractMessageReaderArgumentResolver extends HandlerMethodArgumentResolverSupport
Abstract base class for argument resolvers that resolve method arguments by reading the request body with anHttpMessageReader
.Applies validation if the method argument is annotated with
@javax.validation.Valid
orValidated
. Validation failure results in anServerWebInputException
.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Sebastien Deleuze
字段概要
从类继承的字段 org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
logger
构造器概要
构造器 限定符 构造器 说明 protected
AbstractMessageReaderArgumentResolver(List<HttpMessageReader<?>> readers)
Constructor withHttpMessageReader
's and aValidator
.protected
AbstractMessageReaderArgumentResolver(List<HttpMessageReader<?>> messageReaders, ReactiveAdapterRegistry adapterRegistry)
Constructor that also accepts aReactiveAdapterRegistry
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 List<HttpMessageReader<?>>
getMessageReaders()
Return the configured message converters.protected reactor.core.publisher.Mono<Object>
readBody(MethodParameter bodyParameter, boolean isBodyRequired, BindingContext bindingContext, ServerWebExchange exchange)
Read the body from a method argument withHttpMessageReader
.protected reactor.core.publisher.Mono<Object>
readBody(MethodParameter bodyParam, MethodParameter actualParam, boolean isBodyRequired, BindingContext bindingContext, ServerWebExchange exchange)
Read the body from a method argument withHttpMessageReader
.从类继承的方法 org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
checkAnnotatedParamNoReactiveWrapper, checkParameterType, checkParameterTypeNoReactiveWrapper, getAdapterRegistry
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver
resolveArgument, supportsParameter
构造器详细资料
AbstractMessageReaderArgumentResolver
protected AbstractMessageReaderArgumentResolver(List<HttpMessageReader<?>> readers)
Constructor withHttpMessageReader
's and aValidator
.- 参数:
readers
- the readers to convert from the request body
AbstractMessageReaderArgumentResolver
protected AbstractMessageReaderArgumentResolver(List<HttpMessageReader<?>> messageReaders, ReactiveAdapterRegistry adapterRegistry)
Constructor that also accepts aReactiveAdapterRegistry
.- 参数:
messageReaders
- readers to convert from the request bodyadapterRegistry
- for adapting to other reactive types from Flux and Mono
方法详细资料
getMessageReaders
public List<HttpMessageReader<?>> getMessageReaders()
Return the configured message converters.
readBody
protected reactor.core.publisher.Mono<Object> readBody(MethodParameter bodyParameter, boolean isBodyRequired, BindingContext bindingContext, ServerWebExchange exchange)
Read the body from a method argument withHttpMessageReader
.- 参数:
bodyParameter
- theMethodParameter
to readisBodyRequired
- true if the body is requiredbindingContext
- the binding context to useexchange
- the current exchange- 返回:
- the body
- 另请参阅:
readBody(MethodParameter, MethodParameter, boolean, BindingContext, ServerWebExchange)
readBody
protected reactor.core.publisher.Mono<Object> readBody(MethodParameter bodyParam, @Nullable MethodParameter actualParam, boolean isBodyRequired, BindingContext bindingContext, ServerWebExchange exchange)
Read the body from a method argument withHttpMessageReader
.- 参数:
bodyParam
- represents the element type for the bodyactualParam
- the actual method argument type; possibly different frombodyParam
, e.g. for anHttpEntity
argumentisBodyRequired
- true if the body is requiredbindingContext
- the binding context to useexchange
- the current exchange- 返回:
- a Mono with the value to use for the method argument
- 从以下版本开始:
- 5.0.2