Class MultiParameterResolverFactory
java.lang.Object
org.axonframework.messaging.core.annotation.MultiParameterResolverFactory
- All Implemented Interfaces:
ParameterResolverFactory
ParameterResolverFactory instance that delegates to multiple other instances, in the order provided.
- Since:
- 2.1.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes an instance that delegates to the givendelegates, in the order provided.MultiParameterResolverFactory(ParameterResolverFactory... delegates) Initializes an instance that delegates to the givendelegates, in the order provided. -
Method Summary
Modifier and TypeMethodDescription@Nullable ParameterResolver<?> createInstance(Executable executable, Parameter[] parameters, int parameterIndex) If available, creates aParameterResolverinstance that can provide a parameter of typeparameterTypefor a given message.Returns the delegates of this instance, in the order they are evaluated to resolve parameters.ordered(List<ParameterResolverFactory> delegates) Creates a MultiParameterResolverFactory instance with the givendelegates, which are automatically ordered based on the@Priorityannotation on their respective classes.ordered(ParameterResolverFactory... delegates) Creates a MultiParameterResolverFactory instance with the givendelegates, which are automatically ordered based on the@Priorityannotation on their respective classes.
-
Constructor Details
-
MultiParameterResolverFactory
Initializes an instance that delegates to the givendelegates, in the order provided. Changes in the given array are not reflected in the created instance.- Parameters:
delegates- The factories providing the parameter values to use
-
MultiParameterResolverFactory
Initializes an instance that delegates to the givendelegates, in the order provided. Changes in the given List are not reflected in the created instance.- Parameters:
delegates- The list of factories providing the parameter values to use
-
-
Method Details
-
ordered
Creates a MultiParameterResolverFactory instance with the givendelegates, which are automatically ordered based on the@Priorityannotation on their respective classes. Classes with the same Priority are kept in the order as provided in thedelegates.If one of the delegates is a MultiParameterResolverFactory itself, that factory's delegates are 'mixed' with the given
delegates, based on their respective order.- Parameters:
delegates- The delegates to include in the factory- Returns:
- an instance delegating to the given
delegates
-
ordered
Creates a MultiParameterResolverFactory instance with the givendelegates, which are automatically ordered based on the@Priorityannotation on their respective classes. Classes with the same Priority are kept in the order as provided in thedelegates.If one of the delegates is a MultiParameterResolverFactory itself, that factory's delegates are 'mixed' with the given
delegates, based on their respective order.- Parameters:
delegates- The delegates to include in the factory- Returns:
- an instance delegating to the given
delegates
-
getDelegates
Returns the delegates of this instance, in the order they are evaluated to resolve parameters.- Returns:
- the delegates of this instance, in the order they are evaluated to resolve parameters
-
createInstance
public @Nullable ParameterResolver<?> createInstance(Executable executable, 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.
-