com.espertech.esper.util
Class ConstructorHelper
java.lang.Object
com.espertech.esper.util.ConstructorHelper
public class ConstructorHelper
- extends java.lang.Object
Helper class to find and invoke a class constructors that matches the types of arguments supplied.
Method Summary |
static java.lang.Object |
invokeConstructor(java.lang.Class clazz,
java.lang.Object[] arguments)
Find and invoke constructor matching the argument number and types returning an instance
of given class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConstructorHelper
public ConstructorHelper()
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 constructarguments
- 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