Top Description Methods
org.springframework.core

public Interface ParameterNameDiscoverer

Known Direct Implementers
org.springframework.core.PrioritizedParameterNameDiscoverer, org.springframework.core.StandardReflectionParameterNameDiscoverer, org.springframework.core.KotlinReflectionParameterNameDiscoverer
Imports
java.lang.reflect.Constructor, .Method, org.springframework.lang.Nullable

Interface to discover parameter names for methods and constructors.

Parameter name discovery is not always possible, but various strategies are available to try, such as looking for debug information that may have been emitted at compile time, and looking for argname annotation values optionally accompanying AspectJ annotated methods.

Authors
Rod Johnson, Adrian Colyer
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

an array of parameter names if the names can be resolved, or null if they cannot
getParameterNames
(Method
the method to find parameter names for
method
)

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

public String[]

Returns:

an array of parameter names if the names can be resolved, or null if they cannot
getParameterNames
(Constructor<?>
the constructor to find parameter names for
ctor
)

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

Method Detail

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

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
@Nullable
getParameterNamesback to summary
public String[] getParameterNames(Constructor<?> ctor)

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
@Nullable