APIdia Launch Partner
Top Description Fields Constructors Methods
org.xml.sax.helpers

pack-priv Class NewInstance

extends Object
Class Inheritance
Imports
java.lang.reflect.InvocationTargetException, java.util.Objects

Create a new instance of a class by name.

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.

Author
Edwin Goei, David Brownell
Version
2.0.1 (sax2r2)

Field Summary

Modifier and TypeField and Description
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod 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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_CLASSback to summary
private static final String DEFAULT_CLASS
DEFAULT_PACKAGEback to summary
private static final String DEFAULT_PACKAGE

Constructor Detail

NewInstanceback to summary
pack-priv NewInstance()

Method Detail

newInstanceback 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.