Package org.apache.commons.jxpath.util
Class MethodLookupUtils
java.lang.Object
org.apache.commons.jxpath.util.MethodLookupUtils
Method lookup utilities, which find static and non-static methods as well
as constructors based on a name and list of parameters.
- Version:
- $Revision: 670727 $ $Date: 2008-06-23 15:10:38 -0500 (Mon, 23 Jun 2008) $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConstructorlookupConstructor(Class targetClass, Object[] parameters) Look up a constructor.static MethodlookupMethod(Class targetClass, String name, Object[] parameters) Look up a method.static MethodlookupStaticMethod(Class targetClass, String name, Object[] parameters) Look up a static method.private static intmatchParameterTypes(Class[] types, Object[] parameters) Return a match code of objects to types.private static intReturn a match code between an object and type.
-
Field Details
-
NO_MATCH
private static final int NO_MATCH- See Also:
-
APPROXIMATE_MATCH
private static final int APPROXIMATE_MATCH- See Also:
-
EXACT_MATCH
private static final int EXACT_MATCH- See Also:
-
-
Constructor Details
-
MethodLookupUtils
public MethodLookupUtils()
-
-
Method Details
-
lookupConstructor
Look up a constructor.- Parameters:
targetClass- the class constructedparameters- arguments- Returns:
- Constructor found if any.
-
lookupStaticMethod
Look up a static method.- Parameters:
targetClass- the owning classname- method nameparameters- method parameters- Returns:
- Method found if any
-
lookupMethod
Look up a method.- Parameters:
targetClass- owning classname- method nameparameters- method parameters- Returns:
- Method found if any
-
matchParameterTypes
Return a match code of objects to types.- Parameters:
types- Class[] of expected typesparameters- Object[] to attempt to match- Returns:
- int code
-
matchType
Return a match code between an object and type.- Parameters:
expected- class to testobject- object to test- Returns:
- int code
-