public class MultiParameterResolverFactory extends Object implements ParameterResolverFactory
Constructor and Description |
---|
MultiParameterResolverFactory(List<ParameterResolverFactory> delegates)
Initializes an instance that delegates to the given
delegates , in the order provided. |
MultiParameterResolverFactory(ParameterResolverFactory... delegates)
Initializes an instance that delegates to the given
delegates , in the order provided. |
Modifier and Type | Method and Description |
---|---|
ParameterResolver |
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. |
List<ParameterResolverFactory> |
getDelegates()
Returns the delegates of this instance, in the order they are evaluated to resolve parameters.
|
static MultiParameterResolverFactory |
ordered(List<ParameterResolverFactory> delegates)
Creates a MultiParameterResolverFactory instance with the given
delegates , which are automatically
ordered based on the @Priority annotation on their respective classes. |
static MultiParameterResolverFactory |
ordered(ParameterResolverFactory... delegates)
Creates a MultiParameterResolverFactory instance with the given
delegates , which are automatically
ordered based on the @Priority annotation on their respective classes. |
public MultiParameterResolverFactory(ParameterResolverFactory... delegates)
delegates
, in the order provided. Changes in
the given array are not reflected in the created instance.delegates
- The factories providing the parameter values to usepublic MultiParameterResolverFactory(List<ParameterResolverFactory> delegates)
delegates
, in the order provided. Changes in
the given List are not reflected in the created instance.delegates
- The list of factories providing the parameter values to usepublic static MultiParameterResolverFactory ordered(ParameterResolverFactory... delegates)
delegates
, which are automatically
ordered based on the @Priority
annotation on their respective classes.
Classes with the same Priority are kept in the order as provided in the delegates
.
If one of the delegates is a MultiParameterResolverFactory itself, that factory's delegates are 'mixed' with
the given delegates
, based on their respective order.
delegates
- The delegates to include in the factorydelegates
public static MultiParameterResolverFactory ordered(List<ParameterResolverFactory> delegates)
delegates
, which are automatically
ordered based on the @Priority
annotation on their respective classes.
Classes with the same Priority are kept in the order as provided in the delegates
.
If one of the delegates is a MultiParameterResolverFactory itself, that factory's delegates are 'mixed' with
the given delegates
, based on their respective order.
delegates
- The delegates to include in the factorydelegates
public List<ParameterResolverFactory> getDelegates()
public ParameterResolver 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–2018. All rights reserved.