Top Description Fields Constructors Methods
org.hibernate.validator.parameternameprovider

public Class ParanamerParameterNameProvider

extends Object
implements ParameterNameProvider
Class Inheritance
All Implemented Interfaces
jakarta.validation.ParameterNameProvider
Imports
java.lang.reflect.Constructor, .Method, java.util.Arrays, .List, jakarta.validation.ParameterNameProvider, com.thoughtworks.paranamer.AdaptiveParanamer, .CachingParanamer, .Paranamer, org.hibernate.validator.internal.engine.DefaultParameterNameProvider

A ParameterNameProvider implementation backed by the ParaNamer library.

The Paranamer implementation to use can be passed when creating a ParanamerParameterNameProvider. By default a AdaptiveParanamer will be used which is wrapped into a CachingParanamer. If no parameter names can be obtained from the configured Paranamer, the default parameter name provider will be used as fall back.

The ParaNamer library must be present on the classpath when using this parameter name provider.

Author
Gunnar Morling
See Also
ParaNamer web site

Field Summary

Modifier and TypeField and Description
private final ParameterNameProvider
private final Paranamer

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public List<String>
getParameterNames(Constructor<?>
the constructor for which the parameter names shall be retrieved; never null
constructor
)

Implements jakarta.validation.ParameterNameProvider.getParameterNames.

Returns the names of the parameters of the given constructor.
public List<String>
getParameterNames(Method
the method for which the parameter names shall be retrieved; never null
method
)

Implements jakarta.validation.ParameterNameProvider.getParameterNames.

Returns the names of the parameters of the given method.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fallBackProviderback to summary
private final ParameterNameProvider fallBackProvider
paranamerback to summary
private final Paranamer paranamer

Constructor Detail

ParanamerParameterNameProviderback to summary
public ParanamerParameterNameProvider()
ParanamerParameterNameProviderback to summary
public ParanamerParameterNameProvider(Paranamer paranamer)

Method Detail

getParameterNamesback to summary
public List<String> getParameterNames(Constructor<?> constructor)

Implements jakarta.validation.ParameterNameProvider.getParameterNames.

Doc from jakarta.validation.ParameterNameProvider.getParameterNames.

Returns the names of the parameters of the given constructor.

Parameters
constructor:Constructor<?>

the constructor for which the parameter names shall be retrieved; never null

Returns:List<String>

a list containing the names of the parameters of the given constructor; may be empty but never null

Annotations
@Override
getParameterNamesback to summary
public List<String> getParameterNames(Method method)

Implements jakarta.validation.ParameterNameProvider.getParameterNames.

Doc from jakarta.validation.ParameterNameProvider.getParameterNames.

Returns the names of the parameters of the given method.

Parameters
method:Method

the method for which the parameter names shall be retrieved; never null

Returns:List<String>

a list containing the names of the parameters of the given method; may be empty but never null

Annotations
@Override