This class contains a static method for creating an instance of a class from an explicit class name. It tries to use the thread's context ClassLoader if possible and falls back to using Class.forName(String).
This code is designed to compile and run on JDK version 1.1 and later including versions of Java 2.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static <T> T | newInstance(Class<T> type, ClassLoader loader, String clsName)
Creates a new instance of the specified class name Package private so this code is not exposed at the API level. |
| DEFAULT_CLASS | back to summary |
|---|---|
| private static final String DEFAULT_CLASS | |
| DEFAULT_PACKAGE | back to summary |
|---|---|
| private static final String DEFAULT_PACKAGE | |
| NewInstance | back to summary |
|---|---|
| pack-priv NewInstance() | |
| newInstance | back to summary |
|---|---|
| pack-priv static <T> T newInstance(Class<T> type, ClassLoader loader, String clsName) throws ClassNotFoundException, IllegalAccessException, InstantiationException Creates a new instance of the specified class name Package private so this code is not exposed at the API level. | |