Top Description Constructors Methods
org.springframework.core

public Class StandardReflectionParameterNameDiscoverer

extends Object
implements ParameterNameDiscoverer
Class Inheritance
All Implemented Interfaces
org.springframework.core.ParameterNameDiscoverer
Imports
java.lang.reflect.Constructor, .Method, .Parameter, org.springframework.lang.Nullable

ParameterNameDiscoverer implementation which uses JDK 8's reflection facilities for introspecting parameter names (based on the "-parameters" compiler flag).

This is a key element of DefaultParameterNameDiscoverer where it is being combined with KotlinReflectionParameterNameDiscoverer if Kotlin is present.

Author
Juergen Hoeller
Since
4.0
See Also
java.lang.reflect.Method#getParameters(), java.lang.reflect.Parameter#getName(), KotlinReflectionParameterNameDiscoverer, DefaultParameterNameDiscoverer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
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.

private String[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StandardReflectionParameterNameDiscovererback to summary
public StandardReflectionParameterNameDiscoverer()

Method Detail

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
getParameterNamesback to summary
private String[] getParameterNames(Parameter[] parameters)
Annotations
@Nullable