List of utility methods to do Reflection Method Static Invoke
Object | invokeStaticMethod(String className, String methodName) Invokes static method methodName in class by given className without parameters. return invokeStaticMethod(className, methodName, new Class<?>[] {}, new Object[] {}); |
Object | invokeStaticMethod(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); |
Object | invokeStaticMethodNoArgs(Class> clazz, String methodName) invoke Static Method No Args return invokeStaticMethod(clazz, methodName, null, null);
|