org.codehaus.janino

Class 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
booleanequals(Object o)
An object is regarded equal to this iff
  • It is also an instance of ByteArrayClassLoader
  • 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).
protected ClassfindClass(String name)
Implements ClassLoader#findClass(String).
inthashCode()

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

Method Detail

equals

public boolean equals(Object o)
An object is regarded equal to this iff Roughly speaking, equal ByteArrayClassLoaders will return functionally identical Classes on ClassLoader#loadClass(java.lang.String).

findClass

protected Class findClass(String name)
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.

hashCode

public int hashCode()