com.espertech.esper.util
Class ConstructorHelper

java.lang.Object
  extended by com.espertech.esper.util.ConstructorHelper

public class ConstructorHelper
extends Object

Helper class to find and invoke a class constructors that matches the types of arguments supplied.


Constructor Summary
ConstructorHelper()
           
 
Method Summary
static Object invokeConstructor(Class clazz, 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 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 construct
arguments - is the arguments for the constructor to match in number and type
Returns:
instance of class
Throws:
IllegalAccessException - thrown if no access to class
NoSuchMethodException - thrown when the constructor is not found
InvocationTargetException - thrown when the ctor throws and exception
InstantiationException - thrown when the class cannot be loaded

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com