DCT Lightfoot v3 API specification

com.dctl.j2me.system
Class ClassLoader

java.lang.Object
  |
  +--com.dctl.j2me.system.ClassLoader
Direct Known Subclasses:
DynamicClassLoader

public class ClassLoader
extends Object

The class loader can be used to dynamically load classes. There is one instance of a class loader in the system and all requests for new classes go through it. The basic sequence is reasonable straightforward. The user calls 'Class.forName()' to load a class. This results in the basic 'ClassLoader.loadClass()' method being called. This calls 'getBuiltinClass()' to try and load a builtin class. If this fails and dynamic loading is enabled then the 'DynamicClassLoader.loadClass()' is called to load the class dynamically.


Field Summary
static ClassLoader defaultClassLoader
          The class loader to use
 
Constructor Summary
ClassLoader()
           
 
Method Summary
 Class loadClass(java.lang.String name)
          Load a class
 InputStream loadResource(java.lang.String name)
          Load a resource.
 void setDynamicClassLoader(ClassLoader dl)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultClassLoader

public static final ClassLoader defaultClassLoader
The class loader to use

Constructor Detail

ClassLoader

public ClassLoader()
Method Detail

loadClass

public Class loadClass(java.lang.String name)
                throws ClassNotFoundException
Load a class

Parameters:
name - The name of the class
Throws:
ClassNotFoundException - if the class cannot be found

setDynamicClassLoader

public void setDynamicClassLoader(ClassLoader dl)

loadResource

public InputStream loadResource(java.lang.String name)
Load a resource. This returns null in the default as there is nowhere to load from

Returns:
the input stream

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification