Class ParanamerParameterNameProvider

  • All Implemented Interfaces:
    ParameterNameProvider

    public class ParanamerParameterNameProvider
    extends Object
    implements ParameterNameProvider
    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
    • Constructor Detail

      • ParanamerParameterNameProvider

        public ParanamerParameterNameProvider()
      • ParanamerParameterNameProvider

        public ParanamerParameterNameProvider​(com.thoughtworks.paranamer.Paranamer paranamer)
    • Method Detail

      • getParameterNames

        public List<String> getParameterNames​(Constructor<?> constructor)
        Description copied from interface: ParameterNameProvider
        Returns the names of the parameters of the given constructor.
        Specified by:
        getParameterNames in interface ParameterNameProvider
        Parameters:
        constructor - the constructor for which the parameter names shall be retrieved; never null
        Returns:
        a list containing the names of the parameters of the given constructor; may be empty but never null
      • getParameterNames

        public List<String> getParameterNames​(Method method)
        Description copied from interface: ParameterNameProvider
        Returns the names of the parameters of the given method.
        Specified by:
        getParameterNames in interface ParameterNameProvider
        Parameters:
        method - the method for which the parameter names shall be retrieved; never null
        Returns:
        a list containing the names of the parameters of the given method; may be empty but never null