public class ReflectionUtils extends Object
| Constructor and Description |
|---|
ReflectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
invokeVirtual(String methodName,
Object onObj,
Class[] declaredArgTypes,
Object... withArgs) |
static <T> T |
invokeVirtualImplicit(String method,
Object onObj) |
static <T> T |
invokeVirtualImplicit(String methodName,
Object onObj,
Object... withArgs)
Invoke any method on a given object that has the given parameters.
|
public static <T> T invokeVirtualImplicit(String method, Object onObj) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
public static <T> T invokeVirtualImplicit(String methodName, Object onObj, Object... withArgs) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
methodName - the name of the method to invoke.onObj - the object to invoke the method onwithArgs - the arguments to passNoSuchMethodException - if method can not found onObjInvocationTargetException - if an error occurs when invoking the methodIllegalAccessExceptionpublic static <T> T invokeVirtual(String methodName, Object onObj, Class[] declaredArgTypes, Object... withArgs) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
Copyright © 2024 OpenClover.org. All rights reserved.