Class ConstructorHelper
java.lang.Object
com.espertech.esper.common.internal.util.ConstructorHelper
Helper class to find and invoke a class constructors that matches the types of arguments supplied.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
hasDefaultConstructor
(Class clazz) static Object
invokeConstructor
(Class clazz, Object[] arguments) Find and invoke constructor matching the argument number and types returning an instance of given class.
-
Constructor Details
-
ConstructorHelper
public ConstructorHelper()
-
-
Method Details
-
hasDefaultConstructor
-
invokeConstructor
public static Object invokeConstructor(Class clazz, Object[] arguments) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException, 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 constructarguments
- is the arguments for the constructor to match in number and type- Returns:
- instance of class
- Throws:
IllegalAccessException
- 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 loaded
-