org.apache.velocity.util.introspection
Class ClassMap
java.lang.Object
|
+--org.apache.velocity.util.introspection.ClassMap
- public class ClassMap
- extends java.lang.Object
- Version:
- $Id: ClassMap.java,v 1.10 2001/05/14 19:44:08 geirm Exp $
- Author:
- Jason van Zyl, Bob McWhirter
Field Summary |
private static ClassMap.CacheMiss |
CACHE_MISS
|
private java.lang.Class |
clazz
Class passed into the constructor used to as
the basis for the Method map. |
private java.util.Map |
methodCache
Cache of Methods, or CACHE_MISS, keyed by method
name and actual arguments used to find it. |
private MethodMap |
methodMap
|
private static java.lang.Object |
OBJECT
|
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. |
private java.lang.String |
makeMethodKey(java.lang.reflect.Method method)
Make a methodKey for the given method using
the concatenation of the name and the
types of the method parameters. |
private static java.lang.String |
makeMethodKey(java.lang.String method,
java.lang.Object[] params)
|
private void |
populateMethodCache()
Populate the Map of direct hits. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
CACHE_MISS
private static final ClassMap.CacheMiss CACHE_MISS
OBJECT
private static final java.lang.Object OBJECT
clazz
private java.lang.Class clazz
- Class passed into the constructor used to as
the basis for the Method map.
methodCache
private java.util.Map methodCache
- Cache of Methods, or CACHE_MISS, keyed by method
name and actual arguments used to find it.
methodMap
private MethodMap methodMap
ClassMap
public ClassMap(java.lang.Class clazz)
- Standard constructor
findMethod
public java.lang.reflect.Method findMethod(java.lang.String name,
java.lang.Object[] params)
- 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.
populateMethodCache
private void populateMethodCache()
- Populate the Map of direct hits. These
are taken from all the public methods
that our class provides.
makeMethodKey
private java.lang.String makeMethodKey(java.lang.reflect.Method method)
- Make a methodKey for the given method using
the concatenation of the name and the
types of the method parameters.
makeMethodKey
private static java.lang.String makeMethodKey(java.lang.String method,
java.lang.Object[] params)
Copyright © 2001 Apache Software Foundation. All Rights Reserved.