Java Reflection Method Invoke invokeMethodWithNoArgs(Object o, Method method)

Here you can find the source of invokeMethodWithNoArgs(Object o, Method method)

Description

invoke Method With No Args

License

Apache License

Declaration

public static Object invokeMethodWithNoArgs(Object o, Method method) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Main {
    public static Object invokeMethodWithNoArgs(Object o, Method method) {
        try {//  w  ww  . ja v  a  2  s.  com
            return method.invoke(o);
        } catch (InvocationTargetException | IllegalAccessException e) {
            return null;
        }
    }
}

Related

  1. invokeMethodQuietly(Object receiver, Method method, Object... args)
  2. invokeMethods(final Object target, final List methods)
  3. invokeMethodsWithAnnotation(final Class annotation, final Object instance, final Object... args)
  4. invokeMethodWithArray2(Object target, Method method, Object[] args)
  5. invokeMethodWithKnownParamTypes(Object object, String methodName, Class[] methodParamTypes, Object... args)
  6. invokeMethodWithoutException(Object object, String methodName, Class[] parameterTypes, Object[] parameters)