Package org.planit.utils.reflection
Class ReflectionUtils
- java.lang.Object
-
- org.planit.utils.reflection.ReflectionUtils
-
public class ReflectionUtils extends Object
Reflection specific utility functions- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description ReflectionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectcreateInstance(String className, Object... constructorParameters)Create an instance of given class name and provided constructor parametersstatic Class<?>[]getParameterTypes(Object[] parameters)Method that constructs the parameter types that go with the passed in parameters.
-
-
-
Method Detail
-
getParameterTypes
public static Class<?>[] getParameterTypes(Object[] parameters)
Method that constructs the parameter types that go with the passed in parameters.- Parameters:
parameters- the parameters- Returns:
- parameter class types
-
createInstance
public static Object createInstance(String className, Object... constructorParameters) throws PlanItException
Create an instance of given class name and provided constructor parameters- Parameters:
className- of the class to be instantiatedconstructorParameters- parameters for constructor- Returns:
- created instance
- Throws:
PlanItException- when error occurs during instantiation
-
-