Class RequestPartMethodArgumentResolver
java.lang.Object
org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
org.springframework.web.reactive.result.method.annotation.AbstractMessageReaderArgumentResolver
org.springframework.web.reactive.result.method.annotation.RequestPartMethodArgumentResolver
- All Implemented Interfaces:
HandlerMethodArgumentResolver
Resolver for
@RequestPart
arguments where the named part is decoded
much like an @RequestBody
argument but based on the content of an
individual part instead. The arguments may be wrapped with a reactive type
for a single value (e.g. Reactor Mono
, RxJava Single
).
This resolver also supports arguments of type Part
which may be
wrapped with a reactive type for a single value or multiple values.
- Since:
- 5.0
- Author:
- Rossen Stoyanchev
-
Field Summary
Fields inherited from class org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
logger
-
Constructor Summary
ConstructorDescriptionRequestPartMethodArgumentResolver
(List<HttpMessageReader<?>> readers, ReactiveAdapterRegistry registry) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<Part>
getPartValues
(MethodParameter parameter, RequestPart requestPart, boolean isRequired, ServerWebExchange exchange) reactor.core.publisher.Mono<Object>
resolveArgument
(MethodParameter parameter, BindingContext bindingContext, ServerWebExchange exchange) Resolve the value for the method parameter.boolean
supportsParameter
(MethodParameter parameter) Whether this resolver supports the given method parameter.Methods inherited from class org.springframework.web.reactive.result.method.annotation.AbstractMessageReaderArgumentResolver
getMessageReaders, readBody, readBody
Methods inherited from class org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
checkAnnotatedParamNoReactiveWrapper, checkParameterType, checkParameterTypeNoReactiveWrapper, getAdapterRegistry
-
Constructor Details
-
RequestPartMethodArgumentResolver
public RequestPartMethodArgumentResolver(List<HttpMessageReader<?>> readers, ReactiveAdapterRegistry registry)
-
-
Method Details
-
supportsParameter
Description copied from interface:HandlerMethodArgumentResolver
Whether this resolver supports the given method parameter.- Parameters:
parameter
- the method parameter
-
resolveArgument
public reactor.core.publisher.Mono<Object> resolveArgument(MethodParameter parameter, BindingContext bindingContext, ServerWebExchange exchange) Description copied from interface:HandlerMethodArgumentResolver
Resolve the value for the method parameter.- Parameters:
parameter
- the method parameterbindingContext
- the binding context to useexchange
- the current exchange- Returns:
Mono
for the argument value, possibly empty
-
getPartValues
public reactor.core.publisher.Flux<Part> getPartValues(MethodParameter parameter, @Nullable RequestPart requestPart, boolean isRequired, ServerWebExchange exchange)
-