org.apache.tiles.util
Class ClassUtil

java.lang.Object
  extended by org.apache.tiles.util.ClassUtil

public final class ClassUtil
extends java.lang.Object

Utilities to work with dynamic class loading and instantiation.

Version:
$Rev: 527536 $ $Date: 2007-04-11 17:44:51 +0200 (Wed, 11 Apr 2007) $

Method Summary
static java.lang.Object instantiate(java.lang.String className)
          Returns an instance of the given class name, by calling the default constructor.
static java.lang.Object instantiate(java.lang.String className, boolean returnNull)
          Returns an instance of the given class name, by calling the default constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instantiate

public static java.lang.Object instantiate(java.lang.String className)
                                    throws TilesException
Returns an instance of the given class name, by calling the default constructor.

Parameters:
className - The class name to load and to instantiate.
Returns:
The new instance of the class name.
Throws:
TilesException - If something goes wrong during instantiation.

instantiate

public static java.lang.Object instantiate(java.lang.String className,
                                           boolean returnNull)
                                    throws TilesException
Returns an instance of the given class name, by calling the default constructor.

Parameters:
className - The class name to load and to instantiate.
returnNull - If true, if the class is not found it returns true, otherwise it throws a TilesException.
Returns:
The new instance of the class name.
Throws:
TilesException - If something goes wrong during instantiation.