Package io.jmix.core.impl.method
Class CachedArgumentResolverComposite
java.lang.Object
io.jmix.core.impl.method.CachedArgumentResolverComposite
- All Implemented Interfaces:
ArgumentResolverComposite
,MethodArgumentResolver
- Direct Known Subclasses:
ContextArgumentResolverComposite
,MethodArgumentResolverComposite
public abstract class CachedArgumentResolverComposite
extends Object
implements MethodArgumentResolver, ArgumentResolverComposite
Resolves method parameters by delegating to a list of registered
MethodArgumentResolvers
.
Previously resolved method parameters are cached for faster lookups.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract List<MethodArgumentResolver>
Return a read-only list with the contained resolvers, or an empty list.resolveArgument
(org.springframework.core.MethodParameter parameter) Iterate over registeredMethodArgumentResolvers
and invoke the one that supports it.boolean
supportsParameter
(org.springframework.core.MethodParameter parameter) Whether the given method parameter is supported by any registeredMethodArgumentResolver
.
-
Constructor Details
-
CachedArgumentResolverComposite
public CachedArgumentResolverComposite()
-
-
Method Details
-
getResolvers
Return a read-only list with the contained resolvers, or an empty list.- Specified by:
getResolvers
in interfaceArgumentResolverComposite
-
supportsParameter
public boolean supportsParameter(org.springframework.core.MethodParameter parameter) Whether the given method parameter is supported by any registeredMethodArgumentResolver
.- Specified by:
supportsParameter
in interfaceMethodArgumentResolver
- Parameters:
parameter
- the method parameter to check- Returns:
true
if this resolver supports the supplied parameter;false
otherwise
-
resolveArgument
@Nullable public Object resolveArgument(org.springframework.core.MethodParameter parameter) throws Exception Iterate over registeredMethodArgumentResolvers
and invoke the one that supports it.- Specified by:
resolveArgument
in interfaceMethodArgumentResolver
- Parameters:
parameter
- the method parameter to resolve. This parameter must have previously been passed toMethodArgumentResolver.supportsParameter(org.springframework.core.MethodParameter)
which must have returnedtrue
.- Returns:
- the resolved argument value, or
null
if not resolvable - Throws:
IllegalArgumentException
- if no suitable argument resolver is foundException
- in case of errors with the preparation of argument values
-