invokeConstructor
public static java.lang.Object invokeConstructor(java.lang.Class clazz,
java.lang.Object[] arguments)
throws java.lang.IllegalAccessException,
java.lang.NoSuchMethodException,
java.lang.reflect.InvocationTargetException,
java.lang.InstantiationException
Find and invoke constructor matching the argument number and types returning an instance
of given class.
- Parameters:
clazz
- is the class of instance to construct
arguments
- is the arguments for the constructor to match in number and type
- Returns:
- instance of class
- Throws:
java.lang.IllegalAccessException
- thrown if no access to class
java.lang.NoSuchMethodException
- thrown when the constructor is not found
java.lang.reflect.InvocationTargetException
- thrown when the ctor throws and exception
java.lang.InstantiationException
- thrown when the class cannot be loaded