public class ConstructorHelper extends Object
Constructor and Description |
---|
ConstructorHelper() |
Modifier and Type | Method and Description |
---|---|
static Object |
invokeConstructor(Class clazz,
Object[] arguments)
Find and invoke constructor matching the argument number and types returning an instance
of given class.
|
public static Object invokeConstructor(Class clazz, Object[] arguments) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException, InstantiationException
clazz
- is the class of instance to constructarguments
- is the arguments for the constructor to match in number and typeIllegalAccessException
- thrown if no access to classNoSuchMethodException
- thrown when the constructor is not foundInvocationTargetException
- thrown when the ctor throws and exceptionInstantiationException
- thrown when the class cannot be loadedCopyright © 2005–2018. All rights reserved.