public final class ClassUtils extends Object
Utility methods to load application classes and create instances.
Constructor and Description |
---|
ClassUtils() |
Modifier and Type | Method and Description |
---|---|
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.
|
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.
className
- Fully qualified class nameClassNotFoundException
- if the specified class cannot be loadedpublic 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.
className
- Fully qualified class nameClassNotFoundException
- if the specified class cannot be loadedIllegalAccessException
- if this class is not concreteInstantiationException
- if this class has no zero-arguments
constructorCopyright © 2000–2017 Apache Software Foundation. All rights reserved.