Web Site

org.codehaus.janino
Class ByteArrayClassLoader

java.lang.Object
  extended byjava.lang.ClassLoader
      extended byorg.codehaus.janino.ByteArrayClassLoader

public class ByteArrayClassLoader
extends ClassLoader

This ClassLoader allows for the loading of a set of JavaTM classes provided in class file format.


Constructor Summary
ByteArrayClassLoader(Map classes)
          The given Map of classes must not be modified afterwards.
ByteArrayClassLoader(Map classes, ClassLoader parent)
           
 
Method Summary
 boolean equals(ByteArrayClassLoader that)
          Two ByteArrayClassLoaders are regarded equal iff Both have the same parent ClassLoader Exactly the same classes (name, bytecode) were added to both Roughly speaking, equal ByteArrayClassLoaders will return functionally identical Classes on ClassLoader.loadClass(java.lang.String).
 boolean equals(Object that)
          An object is regarded equal to this iff It is an instance of ByteArrayClassLoader equals(ByteArrayClassLoader) returns true
protected  Class findClass(String name)
          Implements ClassLoader.findClass(String).
 int hashCode()
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayClassLoader

public ByteArrayClassLoader(Map classes)
The given Map of classes must not be modified afterwards.

Parameters:
classes - String className => byte[] data

ByteArrayClassLoader

public ByteArrayClassLoader(Map classes,
                            ClassLoader parent)
See Also:
ByteArrayClassLoader(Map)
Method Detail

findClass

protected Class findClass(String name)
                   throws ClassNotFoundException
Implements ClassLoader.findClass(String).

Notice that, although nowhere documented, no more than one thread at a time calls this method, because ClassLoader.loadClass(java.lang.String) is synchronized.

Throws:
ClassNotFoundException

equals

public boolean equals(Object that)
An object is regarded equal to this iff

See Also:
equals(ByteArrayClassLoader)

equals

public boolean equals(ByteArrayClassLoader that)
Two ByteArrayClassLoaders are regarded equal iff Roughly speaking, equal ByteArrayClassLoaders will return functionally identical Classes on ClassLoader.loadClass(java.lang.String).


hashCode

public int hashCode()

Web Site