public static boolean hasMethod ( Class < ? > targetClass , String methodName , Class ... parameterTypes ) { try { targetClass . getMethod ( methodName , parameterTypes ) ; return true ; } catch ( NoSuchMethodException e ) { return false ; } }
Check if target class has the given method