|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.velocity.util.introspection.MethodMap
Nested Class Summary | |
class |
MethodMap.AmbiguousException
simple distinguishable exception, used when we run across ambiguous overloading |
private class |
MethodMap.Twonk
little class to hold 'distance' information for calling params, as well as determine specificity |
Field Summary | |
(package private) java.util.Map |
methodByNameMap
Keep track of all methods with the same name. |
Constructor Summary | |
MethodMap()
|
Method Summary | |
void |
add(java.lang.reflect.Method method)
Add a method to a list of methods by name. |
private MethodMap.Twonk |
calcDistance(java.lang.Object[] set,
java.lang.Class[] base)
Calculates the distance, expressed as a vector of inheritance steps, between the calling args and the method args. |
java.lang.reflect.Method |
find(java.lang.String methodName,
java.lang.Object[] params)
Find a method. |
java.util.List |
get(java.lang.String key)
Return a list of methods with the same name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.util.Map methodByNameMap
Constructor Detail |
public MethodMap()
Method Detail |
public void add(java.lang.reflect.Method method)
public java.util.List get(java.lang.String key)
public java.lang.reflect.Method find(java.lang.String methodName, java.lang.Object[] params) throws MethodMap.AmbiguousException
Find a method. Attempts to find the most appropriate method using the sense of 'specificity'.
This turns out to be a relatively rare case where this is needed - however, functionality like this is needed. This may not be the optimum approach, but it works.
MethodMap.AmbiguousException
private MethodMap.Twonk calcDistance(java.lang.Object[] set, java.lang.Class[] base)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |