Home » xml-commons-external-1.4.01-src » org.xml » sax » helpers » [javadoc | source]
org.xml.sax.helpers
class: NewInstance [javadoc | source]
java.lang.Object
   org.xml.sax.helpers.NewInstance
Create a new instance of a class by name.
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.

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). It also takes into account JDK 1.2+'s AccessController mechanism for performing its actions.

This code is designed to compile and run on JDK version 1.1 and later including versions of Java 2.

This is not the NewInstance accompanying SAX 2.0.2; it represents many fixes to that code.

Method from org.xml.sax.helpers.NewInstance Summary:
getClassLoader,   newInstance
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.xml.sax.helpers.NewInstance Detail:
 static ClassLoader getClassLoader() 
    Figure out which ClassLoader to use. For JDK 1.2 and later use the context ClassLoader.
 static Object newInstance(ClassLoader classLoader,
    String className) 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.