Package org.apache.jorphan.reflect
Class ClassTools
-
- All Implemented Interfaces:
public class ClassToolsUtility methods for handling dynamic access to classes.
-
-
Constructor Summary
Constructors Constructor Description ClassTools()
-
Method Summary
Modifier and Type Method Description static Objectconstruct(String className)Call no-args constructor for a class. static Objectconstruct(String className, int parameter)Call a class constructor with an integer parameter static Objectconstruct(String className, String parameter)Call a class constructor with an String parameter static voidinvoke(Object instance, String methodName)Invoke a public method on a class instance -
-
Method Detail
-
construct
static Object construct(String className)
Call no-args constructor for a class.
- Parameters:
className- name of the class to be constructed- Returns:
an instance of the class
-
construct
static Object construct(String className, int parameter)
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
-
construct
static Object construct(String className, String parameter)
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
-
-
-
-