org.codehaus.plexus.util.introspection
public class ClassMap extends Object
Version: $Id: ClassMap.java 5958 2007-02-28 10:29:55Z olamy $
Nested Class Summary | |
---|---|
static class | ClassMap.CacheMiss |
static class | ClassMap.MethodInfo
Used for the iterative discovery process for public methods. |
Field Summary | |
---|---|
Class | clazz
Class passed into the constructor used to as
the basis for the Method map. |
static ClassMap.CacheMiss | CACHE_MISS |
Map | methodCache
Cache of Methods, or CACHE_MISS, keyed by method
name and actual arguments used to find it. |
MethodMap | methodMap |
static Object | OBJECT |
Constructor Summary | |
---|---|
ClassMap(Class clazz)
Standard constructor |
Method Summary | |
---|---|
Method | findMethod(String name, Object[] params)
Find a Method using the methodKey
provided.
|
static Method[] | getAccessibleMethods(Class clazz)
Retrieves public methods for a class. |
static int | getAccessibleMethods(Class clazz, ClassMap.MethodInfo[] methodInfos, int upcastCount)
Recursively finds a match for each method, starting with the class, and then
searching the superclass and interfaces.
|
Class | getCachedClass() |
static Method | getPublicMethod(Method method)
For a given method, retrieves its publicly accessible counterpart.
|
static Method | getPublicMethod(Class clazz, String name, Class[] paramTypes)
Looks up the method with specified name and signature in the first public
superclass or implemented interface of the class.
|
String | makeMethodKey(Method method)
Make a methodKey for the given method using
the concatenation of the name and the
types of the method parameters. |
static String | makeMethodKey(String method, Object[] params) |
void | populateMethodCache()
Populate the Map of direct hits. |
Parameters: clazz Class to check methodInfos array of methods we are searching to match upcastCount current number of methods we have matched
Returns: count of matched methods
Returns: the class object whose methods are cached by this map.
Parameters: method a method whose publicly callable counterpart is requested.
Returns: the publicly callable counterpart method. Note that if the parameter method is itself declared by a public class, this method is an identity function.
Parameters: class the class whose method is sought name the name of the method paramTypes the classes of method parameters