Class ClassMap.MethodCache
java.lang.Object
org.apache.velocity.util.introspection.ClassMap.MethodCache
- Enclosing class:
- ClassMap
This is the cache to store and look up the method information.
- Version:
- $Id: ClassMap.java 778038 2009-05-23 21:52:50Z nbubna $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
Cache of Methods, or CACHE_MISS, keyed by method name and actual arguments used to find it.private static final Object
private static final Map
private final Log
Class loggerprivate final MethodMap
Map of methods that are searchable according to method parameters to find a matchprivate static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFind a Method using the method name and parameter objects.private String
makeMethodKey
(Method method) Make a methodKey for the given method using the concatenation of the name and the types of the method parameters.private String
makeMethodKey
(String method, Object[] params) private void
-
Field Details
-
CACHE_MISS
-
NULL_ARG
-
convertPrimitives
-
log
Class logger -
cache
Cache of Methods, or CACHE_MISS, keyed by method name and actual arguments used to find it. -
methodMap
Map of methods that are searchable according to method parameters to find a match
-
-
Constructor Details
-
MethodCache
-
-
Method Details
-
get
Find a Method using the method name and parameter objects. 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.- 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.
-
put
-
makeMethodKey
Make a methodKey for the given method using the concatenation of the name and the types of the method parameters.- Parameters:
method
- to be stored as key- Returns:
- key for ClassMap
-
makeMethodKey
-