Class TypedParameterResolver<M>
java.lang.Object
io.fluxzero.common.handling.TypedParameterResolver<M>
- Type Parameters:
M- the message or context type used for resolution (e.g.HasMessage,Object, etc.)
- All Implemented Interfaces:
ParameterResolver<M>
- Direct Known Subclasses:
CurrentUserParameterResolver, MetadataParameterResolver, UserParameterResolver
Abstract base class for
ParameterResolvers that resolve parameters based on type matching.
This class provides a default matches(Parameter, Annotation, M) implementation that checks whether the expected type of the parameter
is assignable from a configured base type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatches(Parameter parameter, Annotation methodAnnotation, M value) Determines whether the given parameter is eligible to be resolved by this resolver.booleanmayApply(Executable method, Class<?> targetClass) Determines whether this resolver may be applicable to the given method or constructor.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ParameterResolver
determinesSpecificity, resolve, test
-
Constructor Details
-
TypedParameterResolver
public TypedParameterResolver()
-
-
Method Details
-
matches
Determines whether the given parameter is eligible to be resolved by this resolver.This default implementation matches if
parameter.getType()is assignable from the configured base type.- Specified by:
matchesin interfaceParameterResolver<M>- Parameters:
parameter- the method parameter to resolvemethodAnnotation- the annotation on the method (if any)value- the current message or context object- Returns:
trueif this resolver can resolve the parameter
-
mayApply
Determines whether this resolver may be applicable to the given method or constructor.- Specified by:
mayApplyin interfaceParameterResolver<M>- Parameters:
method- the handler method or constructortargetClass- the declaring or target class- Returns:
trueif this resolver could apply,falseotherwise
-