public class HandlerMethodArgumentResolverComposite extends java.lang.Object implements HandlerMethodArgumentResolver
HandlerMethodArgumentResolver
. Previously resolved method parameters are cached
for faster lookups.Modifier and Type | Field and Description |
---|---|
private java.util.Map<MethodParameter,HandlerMethodArgumentResolver> |
argumentResolverCache |
private java.util.List<HandlerMethodArgumentResolver> |
argumentResolvers |
Constructor and Description |
---|
HandlerMethodArgumentResolverComposite() |
private final java.util.List<HandlerMethodArgumentResolver> argumentResolvers
private final java.util.Map<MethodParameter,HandlerMethodArgumentResolver> argumentResolverCache
public HandlerMethodArgumentResolverComposite()
public HandlerMethodArgumentResolverComposite addResolver(HandlerMethodArgumentResolver argumentResolver)
HandlerMethodArgumentResolver
.public HandlerMethodArgumentResolverComposite addResolvers(HandlerMethodArgumentResolver... resolvers)
HandlerMethodArgumentResolver
s.public HandlerMethodArgumentResolverComposite addResolvers(java.util.List<? extends HandlerMethodArgumentResolver> argumentResolvers)
HandlerMethodArgumentResolver
s.public java.util.List<HandlerMethodArgumentResolver> getResolvers()
public void clear()
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 java.lang.Object resolveArgument(MethodParameter parameter, Message<?> message) throws java.lang.Exception
HandlerMethodArgumentResolver
s and invoke the one that supports it.resolveArgument
in interface HandlerMethodArgumentResolver
parameter
- the method parameter to resolve.
This parameter must have previously been passed to
HandlerMethodArgumentResolver.supportsParameter(org.springframework.core.MethodParameter)
which must have returned true
.message
- the currently processed messagenull
java.lang.IllegalStateException
- if no suitable HandlerMethodArgumentResolver
is found.java.lang.Exception
- in case of errors with the preparation of argument valuesprivate HandlerMethodArgumentResolver getArgumentResolver(MethodParameter parameter)
HandlerMethodArgumentResolver
that supports the given method parameter.