Class AbstractAnnotatedParameterResolverFactory<A extends Annotation,P>
java.lang.Object
org.axonframework.messaging.core.annotation.AbstractAnnotatedParameterResolverFactory<A,P>
- Type Parameters:
A- The type of annotation to check forP- The type the parameter needs to be assignable from.
- All Implemented Interfaces:
ParameterResolverFactory
- Direct Known Subclasses:
AggregateTypeParameterResolverFactory,MessageIdentifierParameterResolverFactory,SequenceNumberParameterResolverFactory,SourceIdParameterResolverFactory,TimestampParameterResolverFactory
public abstract class AbstractAnnotatedParameterResolverFactory<A extends Annotation,P>
extends Object
implements ParameterResolverFactory
ParameterResolverFactory that will supply a parameter resolver when a matching parameter annotation is paired
with a suitable type of parameter.
Handling is in place to ensure that primitive parameter types will be resolved correctly from their respective wrapper types.
- Since:
- 2.1.0
- Author:
- Mark Ingram
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAnnotatedParameterResolverFactory(Class<A> annotationType, Class<P> declaredParameterType) Initialize a ParameterResolverFactory instance that resolves parameters of typedeclaredParameterTypeannotated with the givenannotationType. -
Method Summary
Modifier and TypeMethodDescriptioncreateInstance(Executable executable, Parameter[] parameters, int parameterIndex) If available, creates aParameterResolverinstance that can provide a parameter of typeparameterTypefor a given message.protected abstract ParameterResolver<P>
-
Constructor Details
-
AbstractAnnotatedParameterResolverFactory
protected AbstractAnnotatedParameterResolverFactory(Class<A> annotationType, Class<P> declaredParameterType) Initialize a ParameterResolverFactory instance that resolves parameters of typedeclaredParameterTypeannotated with the givenannotationType.- Parameters:
annotationType- the type of annotation that a prospective parameter should declaredeclaredParameterType- the type that the parameter value should be assignable to
-
-
Method Details
-
getResolver
- Returns:
- the parameter resolver that is supplied when a matching parameter is located
-
createInstance
@Nullable public ParameterResolver<P> createInstance(@Nonnull Executable executable, @Nonnull Parameter[] parameters, int parameterIndex) Description copied from interface:ParameterResolverFactoryIf available, creates aParameterResolverinstance that can provide a parameter of typeparameterTypefor a given message.If the
ParameterResolverFactorycannot provide a suitableParameterResolver, returnsnull.- Specified by:
createInstancein interfaceParameterResolverFactory- Parameters:
executable- The executable (constructor or method) to inspect.parameters- The parameters on the executable to inspect.parameterIndex- The index of the parameter to return aParameterResolverfor.- Returns:
- A suitable
ParameterResolver, ornullif none is found.
-