Top Description Constructors Methods
org.springframework.core

public Class KotlinReflectionParameterNameDiscoverer

extends Object
implements ParameterNameDiscoverer
Class Inheritance
All Implemented Interfaces
org.springframework.core.ParameterNameDiscoverer
Imports
java.lang.reflect.Constructor, .Method, java.util.List, kotlin.reflect.KFunction, kotlin.reflect.KParameter, kotlin.reflect.jvm.ReflectJvmMapping, org.springframework.lang.Nullable

ParameterNameDiscoverer implementation which uses Kotlin's reflection facilities for introspecting parameter names.

Compared to StandardReflectionParameterNameDiscoverer, it allows in addition to determine interface parameter names without requiring Java 8 -parameters compiler flag.

Author
Sebastien Deleuze
Since
5.0
See Also
StandardReflectionParameterNameDiscoverer, 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[]
getParameterNames(List<kotlin.reflect.KParameter> parameters)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

KotlinReflectionParameterNameDiscovererback to summary
public KotlinReflectionParameterNameDiscoverer()

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(List<kotlin.reflect.KParameter> parameters)
Annotations
@Nullable