org.apache.struts.chain.commands.util
Class ClassUtils

java.lang.Object
  extended by org.apache.struts.chain.commands.util.ClassUtils

public final class ClassUtils
extends Object

Utility methods to load application classes and create instances.

Version:
$Rev: 471754 $ $Date: 2005-11-12 13:01:44 -0500 (Sat, 12 Nov 2005) $

Constructor Summary
ClassUtils()
           
 
Method Summary
static Class getApplicationClass(String className)
          Return the Class object for the specified fully qualified class name, from this web application's class loader.
static Object getApplicationInstance(String className)
          Return a new instance of the specified fully qualified class name, after loading the class (if necessary) from this web application's class loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassUtils

public ClassUtils()
Method Detail

getApplicationClass

public static Class getApplicationClass(String className)
                                 throws ClassNotFoundException

Return the Class object for the specified fully qualified class name, from this web application's class loader.

Parameters:
className - Fully qualified class name
Throws:
ClassNotFoundException - if the specified class cannot be loaded

getApplicationInstance

public static Object getApplicationInstance(String className)
                                     throws ClassNotFoundException,
                                            IllegalAccessException,
                                            InstantiationException

Return a new instance of the specified fully qualified class name, after loading the class (if necessary) from this web application's class loader.

Parameters:
className - Fully qualified class name
Throws:
ClassNotFoundException - if the specified class cannot be loaded
IllegalAccessException - if this class is not concrete
InstantiationException - if this class has no zero-arguments constructor


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.