Recherche d ’une méthode
private static Method internalFindMethod(Class start,String methodName,int argCount)
{ // For overriden methods we need to find the most derived version.
// So we start with the given class and walk up the superclass chain.
for (Class cl = start; cl != null; cl = cl.getSuperclass()) {
Method methods[] = getPublicDeclaredMethods(cl);
for (int i = 0; i < methods.length; i++) {
Method method = methods[i];
if (method == null) {continue;}
// skip statique methods.
int mods = method.getModifiers();
if (Modifier.isStatic(mods)) {continue; }
if (method.getName().equals(methodName) && (method.getParameterTypes().length == argCount) {
} // Now check any inherited interfaces.
Class ifcs[] = start.getInterfaces();…