spring-framework / org.springframework.util / ReflectionUtils / invokeMethod

invokeMethod

@Nullable open static fun invokeMethod(method: Method, @Nullable target: Any): Any

Invoke the specified Method against the supplied target object with no arguments. The target object can be null when invoking a static Method.

Thrown exceptions are handled via a call to #handleReflectionException.

Parameters

method - the method to invoke

target - the target object to invoke the method on

Return
the invocation result, if any

See Also
#invokeMethod(java.lang.reflect.Method, Object, Object[])

@Nullable open static fun invokeMethod(method: Method, @Nullable target: Any, @Nullable vararg args: Any): Any

Invoke the specified Method against the supplied target object with the supplied arguments. The target object can be null when invoking a static Method.

Thrown exceptions are handled via a call to #handleReflectionException.

Parameters

method - the method to invoke

target - the target object to invoke the method on

args - the invocation arguments (may be null)

Return
the invocation result, if any