com.espertech.esper.util
Class ConstructorHelper

java.lang.Object
  extended by 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.


Constructor Summary
ConstructorHelper()
           
 
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
 

Constructor Detail

ConstructorHelper

public ConstructorHelper()
Method Detail

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

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com