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 java.lang.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 java.lang.Class getApplicationClass(java.lang.String className)
          Return the Class object for the specified fully qualified class name, from this web application's class loader.
static java.lang.Object getApplicationInstance(java.lang.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 java.lang.Class getApplicationClass(java.lang.String className)
                                           throws java.lang.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:
java.lang.ClassNotFoundException - if the specified class cannot be loaded

getApplicationInstance

public static java.lang.Object getApplicationInstance(java.lang.String className)
                                               throws java.lang.ClassNotFoundException,
                                                      java.lang.IllegalAccessException,
                                                      java.lang.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:
java.lang.ClassNotFoundException - if the specified class cannot be loaded
java.lang.IllegalAccessException - if this class is not concrete
java.lang.InstantiationException - if this class has no zero-arguments constructor


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