public class ClassMap
extends java.lang.Object
Method
objects by a concatenation of the
method name and the names of classes that make up the parameters.Modifier and Type | Class and Description |
---|---|
private static class |
ClassMap.MethodCache
This is the cache to store and look up the method information.
|
Modifier and Type | Field and Description |
---|---|
private java.lang.Class<?> |
clazz
Class passed into the constructor used to as
the basis for the Method map.
|
private static boolean |
debugReflection
Set true if you want to debug the reflection code
|
private org.slf4j.Logger |
log
Class logger
|
private ClassMap.MethodCache |
methodCache |
Constructor and Description |
---|
ClassMap(java.lang.Class<?> clazz,
org.slf4j.Logger log)
Standard constructor
|
ClassMap(java.lang.Class<?> clazz,
org.slf4j.Logger log,
TypeConversionHandler conversionHandler)
Standard constructor
|
Modifier and Type | Method and Description |
---|---|
private ClassMap.MethodCache |
createMethodCache(TypeConversionHandler conversionHandler)
Populate the Map of direct hits.
|
java.lang.reflect.Method |
findMethod(java.lang.String name,
java.lang.Object[] params)
Find a Method using the method name and parameter objects.
|
java.lang.Class<?> |
getCachedClass()
Returns the class object whose methods are cached by this map.
|
private void |
populateMethodCacheWith(ClassMap.MethodCache methodCache,
java.lang.Class<?> classToReflect) |
private void |
populateMethodCacheWithInterface(ClassMap.MethodCache methodCache,
java.lang.Class<?> iface) |
private static final boolean debugReflection
private final org.slf4j.Logger log
private final java.lang.Class<?> clazz
private final ClassMap.MethodCache methodCache
public ClassMap(java.lang.Class<?> clazz, org.slf4j.Logger log)
clazz
- The class for which this ClassMap gets constructed.log
- loggerpublic ClassMap(java.lang.Class<?> clazz, org.slf4j.Logger log, TypeConversionHandler conversionHandler)
clazz
- The class for which this ClassMap gets constructed.log
- loggerconversionHandler
- conversion handlerpublic java.lang.Class<?> getCachedClass()
public java.lang.reflect.Method findMethod(java.lang.String name, java.lang.Object[] params) throws MethodMap.AmbiguousException
name
- The method name to look up.params
- An array of parameters for the method.MethodMap.AmbiguousException
- When more than one method is a match for the parameters.private ClassMap.MethodCache createMethodCache(TypeConversionHandler conversionHandler)
private void populateMethodCacheWithInterface(ClassMap.MethodCache methodCache, java.lang.Class<?> iface)
private void populateMethodCacheWith(ClassMap.MethodCache methodCache, java.lang.Class<?> classToReflect)