Java Utililty Methods Reflection Method Static Invoke

List of utility methods to do Reflection Method Static Invoke

Description

The list of methods to do Reflection Method Static Invoke are organized into topic(s).

Method

ObjectinvokeStaticMethod(String className, String methodName)
Invokes static method methodName in class by given className without parameters.
return invokeStaticMethod(className, methodName, new Class<?>[] {}, new Object[] {});
ObjectinvokeStaticMethod(String className, String methodName, Object[] args)
invoke Static Method
Class ownerClass = Class.forName(className);
Class[] argsClass = new Class[args.length];
for (int i = 0, j = args.length; i < j; i++) {
    argsClass[i] = args[i].getClass();
Method method = ownerClass.getMethod(methodName, argsClass);
return method.invoke(null, args);
ObjectinvokeStaticMethodNoArgs(Class clazz, String methodName)
invoke Static Method No Args
return invokeStaticMethod(clazz, methodName, null, null);