org.codehaus.plexus.util.introspection
Class ClassMap

java.lang.Object
  extended byorg.codehaus.plexus.util.introspection.ClassMap

public class ClassMap
extends java.lang.Object

A cache of introspection information for a specific class instance. Keys java.lang.Method objects by a concatenation of the method name and the names of classes that make up the parameters.

Version:
$Id: ClassMap.java 5958 2007-02-28 10:29:55Z olamy $
Author:
Jason van Zyl, Bob McWhirter, Attila Szegedi, Geir Magnusson Jr.

Constructor Summary
ClassMap(java.lang.Class clazz)
          Standard constructor
 
Method Summary
 java.lang.reflect.Method findMethod(java.lang.String name, java.lang.Object[] params)
          Find a Method using the methodKey provided.
static java.lang.reflect.Method getPublicMethod(java.lang.reflect.Method method)
          For a given method, retrieves its publicly accessible counterpart.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassMap

public ClassMap(java.lang.Class clazz)
Standard constructor

Method Detail

findMethod

public java.lang.reflect.Method findMethod(java.lang.String name,
                                           java.lang.Object[] params)
                                    throws MethodMap.AmbiguousException
Find a Method using the methodKey provided.

Look in the methodMap for an entry. If found, it'll either be a CACHE_MISS, in which case we simply give up, or it'll be a Method, in which case, we return it.

If nothing is found, then we must actually go and introspect the method from the MethodMap.

Throws:
MethodMap.AmbiguousException

getPublicMethod

public static java.lang.reflect.Method getPublicMethod(java.lang.reflect.Method method)
For a given method, retrieves its publicly accessible counterpart. This method will look for a method with same name and signature declared in a public superclass or implemented interface of this method's declaring class. This counterpart method is publicly callable.

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.


Copyright © 2001-2008 Codehaus. All Rights Reserved.