sf logo

sf.qof.util
Class ObjectInstantiator

java.lang.Object
  extended by sf.qof.util.ObjectInstantiator

public final class ObjectInstantiator
extends Object

Helper class to instantiate an object.


Method Summary
static
<T> T
newInstance(Class<T> clazz, Object[] initArgs)
          Creates a new instance of clazz using the given parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static <T> T newInstance(Class<T> clazz,
                                Object[] initArgs)
Creates a new instance of clazz using the given parameters. If no constructor for the given parameters can be found in clazz an exception is thrown.

Type Parameters:
T - object type
Parameters:
clazz - class type
initArgs - constructor arguments
Returns:
an instance of clazz
Throws:
RuntimeException - instanziation failed

sf logo

Copyright © 2007 brunella ltd. All Rights Reserved.