Package org.codehaus.janino
Class ByteArrayClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- org.codehaus.janino.ByteArrayClassLoader
-
public class ByteArrayClassLoader extends java.lang.ClassLoaderThisClassLoaderallows for the loading of a set of Java™ classes provided in class file format.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayClassLoader(java.util.Map classes)The givenMapof classes must not be modified afterwards.ByteArrayClassLoader(java.util.Map classes, java.lang.ClassLoader parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)An object is regarded equal tothisiff It is also an instance ofByteArrayClassLoaderBoth have the same parentClassLoaderExactly the same classes (name, bytecode) were added to both Roughly speaking, equalByteArrayClassLoaders will return functionally identicalClasses onClassLoader.loadClass(java.lang.String).protected java.lang.ClassfindClass(java.lang.String name)ImplementsClassLoader.findClass(String).inthashCode()-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Constructor Detail
-
ByteArrayClassLoader
public ByteArrayClassLoader(java.util.Map classes)
The givenMapof classes must not be modified afterwards.- Parameters:
classes- String className => byte[] data
-
ByteArrayClassLoader
public ByteArrayClassLoader(java.util.Map classes, java.lang.ClassLoader parent)- See Also:
ByteArrayClassLoader(Map)
-
-
Method Detail
-
findClass
protected java.lang.Class findClass(java.lang.String name) throws java.lang.ClassNotFoundExceptionImplementsClassLoader.findClass(String).Notice that, although nowhere documented, no more than one thread at a time calls this method, because
ClassLoader.loadClass(java.lang.String)issynchronized.- Overrides:
findClassin classjava.lang.ClassLoader- Throws:
java.lang.ClassNotFoundException
-
equals
public boolean equals(java.lang.Object o)
An object is regarded equal tothisiff- It is also an instance of
ByteArrayClassLoader - Both have the same parent
ClassLoader - Exactly the same classes (name, bytecode) were added to both
ByteArrayClassLoaders will return functionally identicalClasses onClassLoader.loadClass(java.lang.String).- Overrides:
equalsin classjava.lang.Object
- It is also an instance of
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-