Class ClassMap
java.lang.Object
org.apache.velocity.util.introspection.ClassMap
A cache of introspection information for a specific class instance.
Keys
Method
objects by a concatenation of the
method name and the names of classes that make up the parameters.- Version:
- $Id: ClassMap.java 778038 2009-05-23 21:52:50Z nbubna $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
This is the cache to store and look up the method information. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Class
Class passed into the constructor used to as the basis for the Method map.private static final boolean
Set true if you want to debug the reflection codeprivate final Log
Class loggerprivate final ClassMap.MethodCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ClassMap.MethodCache
Populate the Map of direct hits.findMethod
(String name, Object[] params) Find a Method using the method name and parameter objects.Returns the class object whose methods are cached by this map.private void
populateMethodCacheWith
(ClassMap.MethodCache methodCache, Class classToReflect) private void
populateMethodCacheWithInterface
(ClassMap.MethodCache methodCache, Class iface)
-
Field Details
-
debugReflection
private static final boolean debugReflectionSet true if you want to debug the reflection code- See Also:
-
log
Class logger -
clazz
Class passed into the constructor used to as the basis for the Method map. -
methodCache
-
-
Constructor Details
-
ClassMap
Standard constructor- Parameters:
clazz
- The class for which this ClassMap gets constructed.
-
-
Method Details
-
getCachedClass
Returns the class object whose methods are cached by this map.- Returns:
- The class object whose methods are cached by this map.
-
findMethod
Find a Method using the method name and parameter objects.- Parameters:
name
- The method name to look up.params
- An array of parameters for the method.- Returns:
- A Method object representing the method to invoke or null.
- Throws:
MethodMap.AmbiguousException
- When more than one method is a match for the parameters.
-
createMethodCache
Populate the Map of direct hits. These are taken from all the public methods that our class, its parents and their implemented interfaces provide. -
populateMethodCacheWithInterface
-
populateMethodCacheWith
-