Java Utililty Methods Method from Class

List of utility methods to do Method from Class

Description

The list of methods to do Method from Class are organized into topic(s).

Method

booleanhasMethod(String clazz, String methodName, Class[] methodTypes)
return true if given method exists
try {
    return hasMethod(Class.forName(clazz), methodName, methodTypes);
} catch (Exception e) {
    return false;
ObjectinvokePrivateMethod(String methodName, Class[] params, Object[] args, Class containingClass, Object invocationTarget)
invoke Private Method
try {
    Method method = containingClass.getDeclaredMethod(methodName, params);
    method.setAccessible(true);
    return method.invoke(invocationTarget, args);
} catch (Exception e) {
    throw new RuntimeException(e);