public class MethodLookupUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static int |
APPROXIMATE_MATCH |
private static int |
EXACT_MATCH |
private static int |
NO_MATCH |
| Constructor and Description |
|---|
MethodLookupUtils() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
private static final int NO_MATCH
private static final int APPROXIMATE_MATCH
private static final int EXACT_MATCH
public static java.lang.reflect.Constructor lookupConstructor(java.lang.Class targetClass,
java.lang.Object[] parameters)
targetClass - the class constructedparameters - argumentspublic 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 parameterspublic static java.lang.reflect.Method lookupMethod(java.lang.Class targetClass,
java.lang.String name,
java.lang.Object[] parameters)
targetClass - owning classname - method nameparameters - method parametersprivate static int matchParameterTypes(java.lang.Class[] types,
java.lang.Object[] parameters)
types - Class[] of expected typesparameters - Object[] to attempt to matchprivate static int matchType(java.lang.Class expected,
java.lang.Object object)
expected - class to testobject - object to test