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