|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.jexl.util.introspection.MethodMap
Nested Class Summary | |
---|---|
static class |
MethodMap.AmbiguousException
simple distinguishable exception, used when we run across ambiguous overloading. |
Field Summary | |
---|---|
protected Map |
methodByNameMap
Keep track of all methods with the same name. |
Constructor Summary | |
---|---|
MethodMap()
|
Method Summary | |
---|---|
void |
add(Method method)
Add a method to a list of methods by name. |
Method |
find(String methodName,
Object[] args)
Find a method. |
List |
get(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 |
protected Map methodByNameMap
Constructor Detail |
public MethodMap()
Method Detail |
public void add(Method method)
method
- the method.public List get(String key)
key
- The method name.
public Method find(String methodName, Object[] args) throws MethodMap.AmbiguousException
Find a method. Attempts to find the most specific applicable method using the algorithm described in the JLS section 15.12.2 (with the exception that it can't distinguish a primitive type argument from an object type argument, since in reflection primitive type arguments are represented by their object counterparts, so for an argument of type (say) java.lang.Integer, it will not be able to decide between a method that takes int and a method that takes java.lang.Integer as a parameter.
This turns out to be a relatively rare case where this is needed - however, functionality like this is needed.
methodName
- name of methodargs
- the actual arguments with which the method is called
MethodMap.AmbiguousException
- if there is more than one maximally specific
applicable method
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |