|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jxpath.util.MethodLookupUtils
public class MethodLookupUtils
Method lookup utilities, which find static and non-static methods as well as constructors based on a name and list of parameters.
Field Summary | |
---|---|
private static int |
APPROXIMATE_MATCH
|
private static int |
EXACT_MATCH
|
private static int |
NO_MATCH
|
Constructor Summary | |
---|---|
MethodLookupUtils()
|
Method Summary | |
---|---|
static java.lang.reflect.Constructor |
lookupConstructor(java.lang.Class targetClass,
java.lang.Object[] parameters)
Look up a constructor. |
static java.lang.reflect.Method |
lookupMethod(java.lang.Class targetClass,
java.lang.String name,
java.lang.Object[] parameters)
Look up a method. |
static java.lang.reflect.Method |
lookupStaticMethod(java.lang.Class targetClass,
java.lang.String name,
java.lang.Object[] parameters)
Look up a static method. |
private static int |
matchParameterTypes(java.lang.Class[] types,
java.lang.Object[] parameters)
Return a match code of objects to types. |
private static int |
matchType(java.lang.Class expected,
java.lang.Object object)
Return a match code between an object and type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int NO_MATCH
private static final int APPROXIMATE_MATCH
private static final int EXACT_MATCH
Constructor Detail |
---|
public MethodLookupUtils()
Method Detail |
---|
public static java.lang.reflect.Constructor lookupConstructor(java.lang.Class targetClass, java.lang.Object[] parameters)
targetClass
- the class constructedparameters
- arguments
public static java.lang.reflect.Method lookupStaticMethod(java.lang.Class targetClass, java.lang.String name, java.lang.Object[] parameters)
targetClass
- the owning classname
- method nameparameters
- method parameters
public static java.lang.reflect.Method lookupMethod(java.lang.Class targetClass, java.lang.String name, java.lang.Object[] parameters)
targetClass
- owning classname
- method nameparameters
- method parameters
private static int matchParameterTypes(java.lang.Class[] types, java.lang.Object[] parameters)
types
- Class[] of expected typesparameters
- Object[] to attempt to match
private static int matchType(java.lang.Class expected, java.lang.Object object)
expected
- class to testobject
- object to test
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |