gnu.jel
Class ImageLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--gnu.jel.ImageLoader

public class ImageLoader
extends java.lang.ClassLoader

Loads the JEL generated classes into memory.

Specifics of JEL generated classes is that the class name UTF8 is always the first entry in the constant pool. This loader will not load other classes.


Field Summary
static java.lang.String classNamePrefix
          Prefix of the expression classname, should be fully qualified with dots replaced by slashes as dictated by Java history ;)
 
Method Summary
static java.lang.Class load(byte[] image)
          Loads given JEL-generated image under its own name.
protected  java.lang.Class loadClass(java.lang.String name, boolean resolve)
           
static java.lang.Class loadRenamed(byte[] image)
          Loads given JEL-generated image under unique name.
 
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classNamePrefix

public static java.lang.String classNamePrefix
Prefix of the expression classname, should be fully qualified with dots replaced by slashes as dictated by Java history ;)

Example: "gnu/jel/generated/E_"

Method Detail

load

public static java.lang.Class load(byte[] image)
Loads given JEL-generated image under its own name.
Parameters:
image - to load
Returns:
the class object for the new class or null if unsuccessful.

loadRenamed

public static java.lang.Class loadRenamed(byte[] image)
Loads given JEL-generated image under unique name.

The unique name is generated by appending a steadily incremented number to the classNamePrefix.

Parameters:
image - to load
Returns:
the class object for the new class or null if unsuccessful.
See Also:
classNamePrefix

loadClass

protected java.lang.Class loadClass(java.lang.String name,
                                    boolean resolve)
                             throws java.lang.ClassNotFoundException
Overrides:
loadClass in class java.lang.ClassLoader