Class ShellMethodArgumentResolverComposite
java.lang.Object
org.springframework.shell.command.invocation.ShellMethodArgumentResolverComposite
- All Implemented Interfaces:
org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver
public class ShellMethodArgumentResolverComposite
extends Object
implements org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver
Resolves method parameters by delegating to a list of registered
HandlerMethodArgumentResolvers
.
Previously resolved method parameters are cached for faster lookups.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddResolver
(org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver resolver) Add the givenHandlerMethodArgumentResolver
.addResolvers
(List<? extends org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> resolvers) Add the givenHandlerMethodArgumentResolvers
.addResolvers
(org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver... resolvers) Add the givenHandlerMethodArgumentResolvers
.void
clear()
Clear the list of configured resolvers and the resolver cache.List<org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver>
Return a read-only list with the contained resolvers, or an empty list.resolveArgument
(org.springframework.core.MethodParameter parameter, org.springframework.messaging.Message<?> message) Iterate over registeredHandlerMethodArgumentResolvers
and invoke the one that supports it.boolean
supportsParameter
(org.springframework.core.MethodParameter parameter) Whether the given method parameter is supported by any registeredHandlerMethodArgumentResolver
.
-
Constructor Details
-
ShellMethodArgumentResolverComposite
public ShellMethodArgumentResolverComposite()
-
-
Method Details
-
addResolver
public ShellMethodArgumentResolverComposite addResolver(org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver resolver) Add the givenHandlerMethodArgumentResolver
. -
addResolvers
public ShellMethodArgumentResolverComposite addResolvers(@Nullable org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver... resolvers) Add the givenHandlerMethodArgumentResolvers
.- Since:
- 4.3
-
addResolvers
public ShellMethodArgumentResolverComposite addResolvers(@Nullable List<? extends org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> resolvers) Add the givenHandlerMethodArgumentResolvers
. -
getResolvers
public List<org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> 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
public boolean supportsParameter(org.springframework.core.MethodParameter parameter) Whether the given method parameter is supported by any registeredHandlerMethodArgumentResolver
.- Specified by:
supportsParameter
in interfaceorg.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver
-
resolveArgument
@Nullable public Object resolveArgument(org.springframework.core.MethodParameter parameter, org.springframework.messaging.Message<?> message) throws Exception Iterate over registeredHandlerMethodArgumentResolvers
and invoke the one that supports it.- Specified by:
resolveArgument
in interfaceorg.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver
- Throws:
IllegalArgumentException
- if no suitable argument resolver is foundException
-