org.springframework.web.reactive.result.method.annotation

## Class AbstractMessageReaderArgumentResolver

- java.lang.Object
- - org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
  - - org.springframework.web.reactive.result.method.annotation.AbstractMessageReaderArgumentResolver

All Implemented Interfaces:
  HandlerMethodArgumentResolver

Direct Known Subclasses:
  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 an `HttpMessageReader`.

Applies validation if the method argument is annotated with `@javax.validation.Valid` or `Validated`. Validation failure results in an `ServerWebInputException`.

Since:
  5.0
Author:
  Rossen Stoyanchev, Sebastien Deleuze

### Field Summary

### Fields inherited from class org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport

`logger`

### Constructor Summary

Constructors
`protected` `AbstractMessageReaderArgumentResolver(List<org.springframework.http.codec.HttpMessageReader<?>> readers)` Constructor with `HttpMessageReader`'s and a `Validator`.
`protected` `AbstractMessageReaderArgumentResolver(List<org.springframework.http.codec.HttpMessageReader<?>> messageReaders, org.springframework.core.ReactiveAdapterRegistry adapterRegistry)` Constructor that also accepts a `ReactiveAdapterRegistry`.

### Method Summary

All Methods Instance Methods Concrete Methods
`List<org.springframework.http.codec.HttpMessageReader<?>>` `getMessageReaders()` Return the configured message converters.
`protected reactor.core.publisher.Mono<Object>` `readBody(org.springframework.core.MethodParameter bodyParameter, boolean isBodyRequired, BindingContext bindingContext, org.springframework.web.server.ServerWebExchange exchange)` Read the body from a method argument with `HttpMessageReader`.
`protected reactor.core.publisher.Mono<Object>` `readBody(org.springframework.core.MethodParameter bodyParam, org.springframework.core.MethodParameter actualParam, boolean isBodyRequired, BindingContext bindingContext, org.springframework.web.server.ServerWebExchange exchange)` Read the body from a method argument with `HttpMessageReader`.

### Methods inherited from class org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport

`checkAnnotatedParamNoReactiveWrapper, checkParameterType, checkParameterTypeNoReactiveWrapper, getAdapterRegistry`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver

`resolveArgument, supportsParameter`

### Constructor Detail

#### AbstractMessageReaderArgumentResolver

    protected AbstractMessageReaderArgumentResolver(List<org.springframework.http.codec.HttpMessageReader<?>> readers)

Constructor with `HttpMessageReader`'s and a `Validator`.

Parameters:
  `readers` - the readers to convert from the request body

#### AbstractMessageReaderArgumentResolver

    protected AbstractMessageReaderArgumentResolver(List<org.springframework.http.codec.HttpMessageReader<?>> messageReaders,
                                                    org.springframework.core.ReactiveAdapterRegistry adapterRegistry)

Constructor that also accepts a `ReactiveAdapterRegistry`.

Parameters:
  `messageReaders` - readers to convert from the request body
  `adapterRegistry` - for adapting to other reactive types from Flux and Mono

### Method Detail

#### getMessageReaders

    public List<org.springframework.http.codec.HttpMessageReader<?>> getMessageReaders()

Return the configured message converters.

#### readBody

    protected reactor.core.publisher.Mono<Object> readBody(org.springframework.core.MethodParameter bodyParameter,
                                                           boolean isBodyRequired,
                                                           BindingContext bindingContext,
                                                           org.springframework.web.server.ServerWebExchange exchange)

Read the body from a method argument with `HttpMessageReader`.

Parameters:
  `bodyParameter` - the `MethodParameter` to read
  `isBodyRequired` - true if the body is required
  `bindingContext` - the binding context to use
  `exchange` - the current exchange
Returns:
  the body
See Also:
  `readBody(MethodParameter, MethodParameter, boolean, BindingContext, ServerWebExchange)`

#### readBody

    protected reactor.core.publisher.Mono<Object> readBody(org.springframework.core.MethodParameter bodyParam,
                                                           @Nullable
                                                           org.springframework.core.MethodParameter actualParam,
                                                           boolean isBodyRequired,
                                                           BindingContext bindingContext,
                                                           org.springframework.web.server.ServerWebExchange exchange)

Read the body from a method argument with `HttpMessageReader`.

Parameters:
  `bodyParam` - represents the element type for the body
  `actualParam` - the actual method argument type; possibly different from `bodyParam`, e.g. for an `HttpEntity` argument
  `isBodyRequired` - true if the body is required
  `bindingContext` - the binding context to use
  `exchange` - the current exchange
Returns:
  a Mono with the value to use for the method argument
Since:
  5.0.2