org.chromattic.common
Class ObjectInstantiator

java.lang.Object
  extended by org.chromattic.common.ObjectInstantiator

public class ObjectInstantiator
extends java.lang.Object

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
ObjectInstantiator()
           
 
Method Summary
static
<T> T
newInstance(java.lang.Class<T> objectClass)
          Intantiates the object with the specified class.
static
<T> T
newInstance(java.lang.String className, java.lang.Class<T> expectedClass)
          Intantiates the object with the specified class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectInstantiator

public ObjectInstantiator()
Method Detail

newInstance

public static <T> T newInstance(java.lang.String className,
                                java.lang.Class<T> expectedClass)
                     throws BuilderException
Intantiates the object with the specified class name. The object class must have a public no argument constructor.

Type Parameters:
T - the type of the class name
Parameters:
className - the class name
expectedClass - the expected class
Returns:
the object instance
Throws:
BuilderException - if anything goes wrong

newInstance

public static <T> T newInstance(java.lang.Class<T> objectClass)
                     throws BuilderException
Intantiates the object with the specified class. The object class must have a public no argument constructor.

Type Parameters:
T - the type of the class name
Parameters:
objectClass - the objct class
Returns:
the object instance
Throws:
BuilderException - if anything goes wrong


Copyright © 2011 eXo Platform SAS. All Rights Reserved.