public static Method findDeclaredMethodByName ( Class < ? > clazz , String methodName ) { for ( Method method : AccessController . doPrivileged ( new GetDeclaredMethodsAction ( clazz ) ) ) { if ( methodName . equals ( method . getName ( ) ) ) { return method ; } } return null ; }
Searches for a declared method with a given name . If the class declares multiple methods with the given name there is no guarantee as of which methods is returned . Null is returned if the class does not declare a method with the given name .