org.chromattic.common
Class ObjectInstantiator
java.lang.Object
org.chromattic.common.ObjectInstantiator
public class ObjectInstantiator
- extends Object
- Version:
- $Revision$
- Author:
- Julien Viet
|
Method Summary |
static
|
newInstance(Class<T> objectClass)
Intantiates the object with the specified class. |
static
|
newInstance(String className,
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 |
ObjectInstantiator
public ObjectInstantiator()
newInstance
public static <T> T newInstance(String className,
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 nameexpectedClass - the expected class
- Returns:
- the object instance
- Throws:
BuilderException - if anything goes wrong
newInstance
public static <T> T newInstance(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 © 2009 eXo Platform SAS. All Rights Reserved.