Package org.apache.jorphan.reflect
Class ClassTools
java.lang.Object
org.apache.jorphan.reflect.ClassTools
Utility methods for handling dynamic access to classes.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
ClassTools
public ClassTools()
-
-
Method Details
-
construct
Call no-args constructor for a class.- Parameters:
className
- name of the class to be constructed- Returns:
- an instance of the class
- Throws:
JMeterException
- if class cannot be created
-
construct
Call a class constructor with an integer parameter- Parameters:
className
- name of the class to be constructedparameter
- the value to be used in the constructor- Returns:
- an instance of the class
- Throws:
JMeterException
- if class cannot be created
-
construct
Call a class constructor with an String parameter- Parameters:
className
- the name of the class to constructparameter
- to be used for the construction of the class instance- Returns:
- an instance of the class
- Throws:
JMeterException
- if class cannot be created
-
invoke
public static void invoke(Object instance, String methodName) throws SecurityException, IllegalArgumentException, JMeterException Invoke a public method on a class instance- Parameters:
instance
- object on which the method should be calledmethodName
- name of the method to be called- Throws:
SecurityException
- if a security violation occurred while looking for the methodIllegalArgumentException
- if the method parameters (none given) do not match the signature of the methodJMeterException
- if something went wrong in the invoked method
-