Top Description Fields Constructors Methods
com.thoughtworks.paranamer

public Class DefaultParanamer

extends Object
implements Paranamer
Class Inheritance
All Implemented Interfaces
com.thoughtworks.paranamer.Paranamer
Imports
java.lang.reflect.Constructor, .Method, .Field, .Modifier, .AccessibleObject

Default implementation of Paranamer reads from a post-compile added field called '__PARANAMER_DATA'
Authors
Paul Hammant, Mauro Talevi, Guilherme Silveira

Field Summary

Modifier and TypeField and Description
public static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static String

Returns:

A list of lines that match the prefix
findFirstMatchingLine
(String
the data encoding the mappings
data
,
String
the String prefix
prefix
)

Filter the mappings and only return lines matching the prefix passed in.

private static String
getParameterListResource(Class<?> declaringClass)

private static String[]
getParameterNames(Class<?> declaringClass, String parameterTypes, String prefix)

private static String
pack-priv static String
getParameterTypeNamesCSV(Class<?>[] parameterTypes)

public String[]
lookupParameterNames(AccessibleObject
the Method or Constructor for which the parameter names are looked up.
methodOrConstructor
)

Implements com.thoughtworks.paranamer.Paranamer.lookupParameterNames.

Lookup the parameter names of a given method.
public String[]
lookupParameterNames(AccessibleObject
the Method or Constructor for which the parameter names are looked up.
methodOrCtor
,
boolean
whether to throw an exception if no Paranamer data found (versus return null).
throwExceptionIfMissing
)

Implements com.thoughtworks.paranamer.Paranamer.lookupParameterNames.

Lookup the parameter names of a given method.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__PARANAMER_DATAback to summary
public static final String __PARANAMER_DATA
COMMAback to summary
private static final String COMMA
SPACEback to summary
private static final String SPACE

Constructor Detail

DefaultParanamerback to summary
public DefaultParanamer()

Method Detail

findFirstMatchingLineback to summary
private static String findFirstMatchingLine(String data, String prefix)

Filter the mappings and only return lines matching the prefix passed in.

Parameters
data:String

the data encoding the mappings

prefix:String

the String prefix

Returns:String

A list of lines that match the prefix

getParameterListResourceback to summary
private static String getParameterListResource(Class<?> declaringClass)
getParameterNamesback to summary
private static String[] getParameterNames(Class<?> declaringClass, String parameterTypes, String prefix)
getParameterTypeNameback to summary
private static String getParameterTypeName(Class<?> cls)
getParameterTypeNamesCSVback to summary
pack-priv static String getParameterTypeNamesCSV(Class<?>[] parameterTypes)
lookupParameterNamesback to summary
public String[] lookupParameterNames(AccessibleObject methodOrConstructor)

Implements com.thoughtworks.paranamer.Paranamer.lookupParameterNames.

Doc from com.thoughtworks.paranamer.Paranamer.lookupParameterNames.

Lookup the parameter names of a given method.

Parameters
methodOrConstructor:AccessibleObject

the Method or Constructor for which the parameter names are looked up.

Returns:String[]

A list of the parameter names.

lookupParameterNamesback to summary
public String[] lookupParameterNames(AccessibleObject methodOrCtor, boolean throwExceptionIfMissing)

Implements com.thoughtworks.paranamer.Paranamer.lookupParameterNames.

Doc from com.thoughtworks.paranamer.Paranamer.lookupParameterNames.

Lookup the parameter names of a given method.

Parameters
methodOrCtor:AccessibleObject

the Method or Constructor for which the parameter names are looked up.

throwExceptionIfMissing:boolean

whether to throw an exception if no Paranamer data found (versus return null).

Returns:String[]

A list of the parameter names.