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

Class RequestPartMethodArgumentResolver

  • All Implemented Interfaces:
    HandlerMethodArgumentResolver


    public class RequestPartMethodArgumentResolver
    extends AbstractMessageReaderArgumentResolver
    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 are reactive type for a single or multiple values.

    Since:
    5.0
    Author:
    Rossen Stoyanchev
    • Method Detail

      • supportsParameter

        public boolean supportsParameter(MethodParameter parameter)
        Description copied from interface: HandlerMethodArgumentResolver
        Whether this resolver supports the given method parameter.
        Parameters:
        parameter - the method parameter
      • resolveArgument

        public reactor.core.publisher.Mono<java.lang.Object> resolveArgument(MethodParameter parameter,
                                                                             BindingContext bindingContext,
                                                                             ServerWebExchange exchange)
        Description copied from interface: HandlerMethodArgumentResolver
        Resolve the value for the method parameter.
        Parameters:
        parameter - the method parameter
        bindingContext - the binding context to use
        exchange - the current exchange
        Returns:
        Mono for the argument value, possibly empty