org.apache.xalan.xsltc.runtime
Class TransletLoader
java.lang.Object
|
+--org.apache.xalan.xsltc.runtime.TransletLoader
- public final class TransletLoader
- extends java.lang.Object
This class is intended used when the default Class.forName() method fails.
This method will fail if XSLTC is installed in a jar-file under the
$JAVA_HOME/jre/lib/ext directory. This is because the extensions class
loader is used instead of the bootstrap class loader, and that the
extensions class loader does not load classes for the default class path.
But, if the extensions class loader is being used, then we know two things:
(1) XSLTC is running on Java 1.2 or later (when extensions were introduced)
(2) XSLTC has access to the ClassLoader.getSystemClassLoader() method
This class takes advantage of this and uses a privileged call to this
method to get a reference to the bootstrap class loader. It then uses this
class loader to load the desired class.
Note that this class should only be _instanciated_ if Class.forName() fails.
And, YES, I do mean _instanciated_, and not called. By instanciating this
class on Java 1.1 you'll get a NoSuchMethodException.
Method Summary |
java.lang.Class |
loadClass(java.lang.String name)
Loads a Class definition, but does not run static initializers |
java.lang.Class |
loadTranslet(java.lang.String name)
Loads a Class definition and runs static initializers. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
TransletLoader
public TransletLoader()
- Create a translet loader.
Get a handle to the system class loader
loadClass
public java.lang.Class loadClass(java.lang.String name)
throws java.lang.ClassNotFoundException
- Loads a Class definition, but does not run static initializers
loadTranslet
public java.lang.Class loadTranslet(java.lang.String name)
throws java.lang.ClassNotFoundException
- Loads a Class definition and runs static initializers.
Copyright © 2003 Apache XML Project. All Rights Reserved.