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$
-
Field Summary
FieldsModifier and TypeFieldDescriptionCache of Methods, or CACHE_MISS, keyed by method name and actual arguments used to find it.private static final Objectprivate final org.slf4j.LoggerClass loggerprivate final MethodMapMap of methods that are searchable according to method parameters to find a matchprivate static final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMethodCache(org.slf4j.Logger log, TypeConversionHandler conversionHandler) -
Method Summary
Modifier and TypeMethodDescriptionFind a Method using the method name and parameter objects.private StringmakeMethodKey(Method method) Make a methodKey for the given method using the concatenation of the name and the types of the method parameters.private StringmakeMethodKey(String method, Object[] params) private void
-
Field Details
-
CACHE_MISS
-
NULL_ARG
-
convertPrimitives
-
log
private final org.slf4j.Logger logClass 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
-