A
- The type of annotation to check forP
- The type the parameter needs to be assignable from.public abstract class AbstractAnnotatedParameterResolverFactory<A extends Annotation,P> extends Object implements ParameterResolverFactory
Handling is in place to ensure that primitive parameter types will be resolved correctly from their respective wrapper types.
Modifier | Constructor and Description |
---|---|
protected |
AbstractAnnotatedParameterResolverFactory(Class<A> annotationType,
Class<P> declaredParameterType)
Initialize a ParameterResolverFactory instance that resolves parameters of type
declaredParameterType annotated with the given annotationType . |
Modifier and Type | Method and Description |
---|---|
ParameterResolver<P> |
createInstance(Executable executable,
Parameter[] parameters,
int parameterIndex)
If available, creates a ParameterResolver instance that can provide a parameter of type
parameterType for a given message. |
protected abstract ParameterResolver<P> |
getResolver() |
protected AbstractAnnotatedParameterResolverFactory(Class<A> annotationType, Class<P> declaredParameterType)
declaredParameterType
annotated with the given annotationType
.annotationType
- the type of annotation that a prospective parameter should declaredeclaredParameterType
- the type that the parameter value should be assignable toprotected abstract ParameterResolver<P> getResolver()
public ParameterResolver<P> createInstance(Executable executable, Parameter[] parameters, int parameterIndex)
ParameterResolverFactory
parameterType
for a given message.
If the ParameterResolverFactory cannot provide a suitable ParameterResolver, returns null
.
createInstance
in interface ParameterResolverFactory
executable
- The executable (constructor or method) to inspectparameters
- The parameters on the executable to inspectparameterIndex
- The index of the parameter to return a ParameterResolver fornull
if none is foundCopyright © 2010–2024. All rights reserved.