com.thoughtworks.paranamer
Interface Paranamer

All Known Implementing Classes:
AdaptiveParanamer, BytecodeReadingParanamer, CachingParanamer, DefaultParanamer, JavadocParanamer

public interface Paranamer

Paranamer allows lookups of methods and constructors by parameter names.

Author:
Paul Hammant, Mauro Talevi

Field Summary
static String[] EMPTY_NAMES
           
static int NO_PARAMETER_NAMES_FOR_CLASS
          Deprecated.  
static int NO_PARAMETER_NAMES_FOR_CLASS_AND_MEMBER
          Deprecated.  
static int NO_PARAMETER_NAMES_LIST
          Deprecated.  
static int PARAMETER_NAMES_FOUND
          Deprecated.  
 
Method Summary
 int areParameterNamesAvailable(Class clazz, String constructorOrMethodName)
          Deprecated. since 1.5, use the overloaded lookupParameterNames instead
 String[] lookupParameterNames(AccessibleObject methodOrConstructor)
          Lookup the parameter names of a given method.
 String[] lookupParameterNames(AccessibleObject methodOrConstructor, boolean throwExceptionIfMissing)
          Lookup the parameter names of a given method.
 

Field Detail

EMPTY_NAMES

static final String[] EMPTY_NAMES

NO_PARAMETER_NAMES_FOR_CLASS

static final int NO_PARAMETER_NAMES_FOR_CLASS
Deprecated. 
Parameter names are available, but not for that class.

See Also:
Constant Field Values

NO_PARAMETER_NAMES_FOR_CLASS_AND_MEMBER

static final int NO_PARAMETER_NAMES_FOR_CLASS_AND_MEMBER
Deprecated. 
Parameter names are available for that class, but not for that constructor or method.

See Also:
Constant Field Values

NO_PARAMETER_NAMES_LIST

static final int NO_PARAMETER_NAMES_LIST
Deprecated. 
Parameter names are generally not available.

See Also:
Constant Field Values

PARAMETER_NAMES_FOUND

static final int PARAMETER_NAMES_FOUND
Deprecated. 
Parameter names are available for that class and constructor/method.

See Also:
Constant Field Values
Method Detail

areParameterNamesAvailable

int areParameterNamesAvailable(Class clazz,
                               String constructorOrMethodName)
Deprecated. since 1.5, use the overloaded lookupParameterNames instead

Determine if the parameter names are available.

Known issues:

Use of this method is discouraged.

Parameters:
clazz - the name of the class to which the method or constructor belongs.
constructorOrMethodName - the base name of the Method or Constructor. If a request is being made for the constructor, this should be "<init>".
Returns:
An int encoding the parameter names availability.
Throws:
NullPointerException - if either parameter is null.
SecurityException - if reflection is not permitted on clazz

lookupParameterNames

String[] lookupParameterNames(AccessibleObject methodOrConstructor)
Lookup the parameter names of a given method.

Parameters:
methodOrConstructor - the Method or Constructor for which the parameter names are looked up.
Returns:
A list of the parameter names.
Throws:
ParameterNamesNotFoundException - if no parameter names were found.
NullPointerException - if the parameter is null.
SecurityException - if reflection is not permitted on the containing Class of the parameter

lookupParameterNames

String[] lookupParameterNames(AccessibleObject methodOrConstructor,
                              boolean throwExceptionIfMissing)
Lookup the parameter names of a given method.

Parameters:
methodOrConstructor - the Method or Constructor for which the parameter names are looked up.
Returns:
A list of the parameter names.
Throws:
ParameterNamesNotFoundException - if no parameter names were found.
NullPointerException - if the parameter is null.
SecurityException - if reflection is not permitted on the containing Class of the parameter


Copyright © 2010. All Rights Reserved.