public class Loader
extends java.lang.Object
| Constructor and Description |
|---|
Loader() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
getInstance(java.lang.Class<?> c,
java.lang.Class<?>[] argtypes,
java.lang.Object[] args)
Creats a new object of a given class.
|
static java.lang.Object |
getInstance(java.lang.String classname)
Creates a new object of given classname.
|
static java.lang.Object |
getInstance(java.lang.String classname,
java.lang.Class<?>[] argtypes,
java.lang.Object[] args)
Creates a new object of given classname.
|
static java.lang.Class<?> |
load(java.lang.String name)
This is a caching Class loader.
|
public static java.lang.Class<?> load(java.lang.String name)
throws java.lang.ClassNotFoundException
name - The name of the class to load.java.lang.ClassNotFoundExceptionpublic static java.lang.Object getInstance(java.lang.String classname)
throws java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.ClassNotFoundException
classname - Name of class to instantiate.java.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.ClassNotFoundExceptionpublic static java.lang.Object getInstance(java.lang.String classname,
java.lang.Class<?>[] argtypes,
java.lang.Object[] args)
throws java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.ClassNotFoundException
classname - Name of class to instantiate.argtypes - The classes of the arguments.args - The arguments. Since this uses the reflect methods
it's ok to wrap primitives.java.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.ClassNotFoundExceptionpublic static java.lang.Object getInstance(java.lang.Class<?> c,
java.lang.Class<?>[] argtypes,
java.lang.Object[] args)
throws java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
c - The class to instantiate.argtypes - The classes of the arguments.args - The arguments. Since this uses the reflect methods
it's ok to wrap primitives.java.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessException