Top Description Fields Constructors Methods
org.springframework.core

public Class PrioritizedParameterNameDiscoverer

extends Object
implements ParameterNameDiscoverer
Class Inheritance
All Implemented Interfaces
org.springframework.core.ParameterNameDiscoverer
Known Direct Subclasses
org.springframework.core.DefaultParameterNameDiscoverer
Imports
java.lang.reflect.Constructor, .Method, java.util.ArrayList, .List, org.springframework.lang.Nullable

ParameterNameDiscoverer implementation that tries several discoverer delegates in succession. Those added first in the addDiscoverer method have the highest priority. If one returns null, the next will be tried.

The default behavior is to return null if no discoverer matches.

Authors
Rod Johnson, Juergen Hoeller
Since
2.0

Field Summary

Modifier and TypeField and Description
private final List<ParameterNameDiscoverer>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addDiscoverer(ParameterNameDiscoverer pnd)

Add a further ParameterNameDiscoverer delegate to the list of discoverers that this PrioritizedParameterNameDiscoverer checks.

public String[]
getParameterNames(Method
the method to find parameter names for
method
)

Implements org.springframework.core.ParameterNameDiscoverer.getParameterNames.

Return parameter names for a method, or null if they cannot be determined.
public String[]
getParameterNames(Constructor<?>
the constructor to find parameter names for
ctor
)

Implements org.springframework.core.ParameterNameDiscoverer.getParameterNames.

Return parameter names for a constructor, or null if they cannot be determined.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parameterNameDiscoverersback to summary
private final List<ParameterNameDiscoverer> parameterNameDiscoverers

Constructor Detail

PrioritizedParameterNameDiscovererback to summary
public PrioritizedParameterNameDiscoverer()

Method Detail

addDiscovererback to summary
public void addDiscoverer(ParameterNameDiscoverer pnd)

Add a further ParameterNameDiscoverer delegate to the list of discoverers that this PrioritizedParameterNameDiscoverer checks.

getParameterNamesback to summary
public String[] getParameterNames(Method method)

Implements org.springframework.core.ParameterNameDiscoverer.getParameterNames.

Doc from org.springframework.core.ParameterNameDiscoverer.getParameterNames.

Return parameter names for a method, or null if they cannot be determined.

Individual entries in the array may be null if parameter names are only available for some parameters of the given method but not for others. However, it is recommended to use stub parameter names instead wherever feasible.

Parameters
method:Method

the method to find parameter names for

Returns:String[]

an array of parameter names if the names can be resolved, or null if they cannot

Annotations
@Override
@Nullable
getParameterNamesback to summary
public String[] getParameterNames(Constructor<?> ctor)

Implements org.springframework.core.ParameterNameDiscoverer.getParameterNames.

Doc from org.springframework.core.ParameterNameDiscoverer.getParameterNames.

Return parameter names for a constructor, or null if they cannot be determined.

Individual entries in the array may be null if parameter names are only available for some parameters of the given constructor but not for others. However, it is recommended to use stub parameter names instead wherever feasible.

Parameters
ctor:Constructor<?>

the constructor to find parameter names for

Returns:String[]

an array of parameter names if the names can be resolved, or null if they cannot

Annotations
@Override
@Nullable