public class DynamicCall
extends java.lang.Object
DynamicCall provides methods for dynamically calling methods in classes
with specified arguments. The class may be specified by its class type or
by name. The method is provided by name. The list of parameters
is passed as an ArgumentList
. DynamicCall uses Java reflection.
Modifier | Constructor and Description |
---|---|
protected |
DynamicCall()
Don't allow instantiation, do allow overrides.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
dynamicCall(java.lang.Object classToCall,
java.lang.String methodName,
ArgumentList argumentList)
Use reflection to call a named method from a specified class.
|
static java.lang.Object |
dynamicCall(java.lang.String className,
java.lang.String methodName,
ArgumentList argumentList)
Use reflection to call a named method from a named class.
|
protected DynamicCall()
public static java.lang.Object dynamicCall(java.lang.Object classToCall, java.lang.String methodName, ArgumentList argumentList) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
classToCall
- The class containing the method to call.methodName
- The method name to call.argumentList
- The argument list.java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public static java.lang.Object dynamicCall(java.lang.String className, java.lang.String methodName, ArgumentList argumentList) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.lang.InstantiationException
className
- The class name containing the method to call.methodName
- The method name to call.argumentList
- The argument list.java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.lang.InstantiationException