Class HandlerMethodArgumentResolverComposite
java.lang.Object
org.springframework.messaging.handler.invocation.reactive.HandlerMethodArgumentResolverComposite
- All Implemented Interfaces:
HandlerMethodArgumentResolver
public class HandlerMethodArgumentResolverComposite
extends Object
implements HandlerMethodArgumentResolver
Resolves method parameters by delegating to a list of registered
HandlerMethodArgumentResolvers
.
Previously resolved method parameters are cached for faster lookups.- Since:
- 5.2
- Author:
- Rossen Stoyanchev
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddResolver
(HandlerMethodArgumentResolver resolver) Add the givenHandlerMethodArgumentResolver
.addResolvers
(List<? extends HandlerMethodArgumentResolver> resolvers) Add the givenHandlerMethodArgumentResolvers
.addResolvers
(HandlerMethodArgumentResolver... resolvers) Add the givenHandlerMethodArgumentResolvers
.void
clear()
Clear the list of configured resolvers and the resolver cache.getArgumentResolver
(MethodParameter parameter) Find a registeredHandlerMethodArgumentResolver
that supports the given method parameter.Return a read-only list with the contained resolvers, or an empty list.reactor.core.publisher.Mono<Object>
resolveArgument
(MethodParameter parameter, Message<?> message) Iterate over registeredHandlerMethodArgumentResolvers
and invoke the one that supports it.boolean
supportsParameter
(MethodParameter parameter) Whether the given method parameter is supported by any registeredHandlerMethodArgumentResolver
.
-
Field Details
-
logger
-
-
Constructor Details
-
HandlerMethodArgumentResolverComposite
public HandlerMethodArgumentResolverComposite()
-
-
Method Details
-
addResolver
Add the givenHandlerMethodArgumentResolver
. -
addResolvers
public HandlerMethodArgumentResolverComposite addResolvers(@Nullable HandlerMethodArgumentResolver... resolvers) Add the givenHandlerMethodArgumentResolvers
. -
addResolvers
public HandlerMethodArgumentResolverComposite addResolvers(@Nullable List<? extends HandlerMethodArgumentResolver> resolvers) Add the givenHandlerMethodArgumentResolvers
. -
getResolvers
Return a read-only list with the contained resolvers, or an empty list. -
clear
public void clear()Clear the list of configured resolvers and the resolver cache. -
supportsParameter
Whether the given method parameter is supported by any registeredHandlerMethodArgumentResolver
.- Specified by:
supportsParameter
in interfaceHandlerMethodArgumentResolver
- Parameters:
parameter
- the method parameter to check- Returns:
true
if this resolver supports the supplied parameter;false
otherwise
-
resolveArgument
public reactor.core.publisher.Mono<Object> resolveArgument(MethodParameter parameter, Message<?> message) Iterate over registeredHandlerMethodArgumentResolvers
and invoke the one that supports it.- Specified by:
resolveArgument
in interfaceHandlerMethodArgumentResolver
- Parameters:
parameter
- the method parameter to resolve. This parameter must have previously been passed toHandlerMethodArgumentResolver.supportsParameter(org.springframework.core.MethodParameter)
which must have returnedtrue
.message
- the currently processed message- Returns:
Mono
for the argument value, possibly empty- Throws:
IllegalStateException
- if no suitableHandlerMethodArgumentResolver
is found.
-
getArgumentResolver
Find a registeredHandlerMethodArgumentResolver
that supports the given method parameter.
-