public class PayloadMethodArgumentResolver extends Object implements HandlerMethodArgumentResolver
Decoder
, where the payload is expected to be a Publisher
of DataBuffer
.
Validation is applied if the method argument is annotated with
Validated
or
@javax.validation.Valid
. Validation failure results in an
MethodArgumentNotValidException
.
This resolver should be ordered last if useDefaultResolution
is
set to true
since in that case it supports all types and does not
require the presence of Payload
.
Constructor and Description |
---|
PayloadMethodArgumentResolver(List<? extends Decoder<?>> decoders,
Validator validator,
ReactiveAdapterRegistry registry,
boolean useDefaultResolution) |
Modifier and Type | Method and Description |
---|---|
ReactiveAdapterRegistry |
getAdapterRegistry()
Return the configured
ReactiveAdapterRegistry . |
List<Decoder<?>> |
getDecoders()
Return a read-only list of the configured decoders.
|
protected MimeType |
getMimeType(Message<?> message)
Return the mime type for the content.
|
Validator |
getValidator()
Return the configured validator, if any.
|
boolean |
isUseDefaultResolution()
Whether this resolver is configured to use default resolution, i.e.
|
reactor.core.publisher.Mono<Object> |
resolveArgument(MethodParameter parameter,
Message<?> message)
Decode the content of the given message payload through a compatible
Decoder . |
boolean |
supportsParameter(MethodParameter parameter)
Whether the given method parameter is
supported by this resolver.
|
protected final Log logger
public List<Decoder<?>> getDecoders()
public ReactiveAdapterRegistry getAdapterRegistry()
ReactiveAdapterRegistry
.public boolean isUseDefaultResolution()
@Payload
is
present or not.public boolean supportsParameter(MethodParameter parameter)
HandlerMethodArgumentResolver
supportsParameter
in interface HandlerMethodArgumentResolver
parameter
- the method parameter to checktrue
if this resolver supports the supplied parameter;
false
otherwisepublic final reactor.core.publisher.Mono<Object> resolveArgument(MethodParameter parameter, Message<?> message)
Decoder
.
Validation is applied if the method argument is annotated with
@javax.validation.Valid
or
Validated
. Validation
failure results in an MethodArgumentNotValidException
.
resolveArgument
in interface HandlerMethodArgumentResolver
parameter
- the target method argument that we are decoding tomessage
- the message from which the content was extractedextractContent(MethodParameter, Message)
,
getMimeType(Message)