Package org.codehaus.janino
Class ByteArrayClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- org.codehaus.janino.ByteArrayClassLoader
-
public class ByteArrayClassLoader extends ClassLoader
ThisClassLoader
allows for the loading of a set of Java™ classes provided in class file format.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayClassLoader(Map<String,byte[]> classes)
The givenMap
of classes must not be modified afterwards.ByteArrayClassLoader(Map<String,byte[]> classes, ClassLoader parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class
findClass(String name)
ImplementsClassLoader.findClass(String)
.-
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(Map<String,byte[]> classes)
The givenMap
of classes must not be modified afterwards.- Parameters:
classes
- String className => byte[] data
-
ByteArrayClassLoader
public ByteArrayClassLoader(Map<String,byte[]> classes, ClassLoader parent)
- See Also:
ByteArrayClassLoader(Map)
-
-
Method Detail
-
findClass
protected Class findClass(String name) throws ClassNotFoundException
ImplementsClassLoader.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:
findClass
in classClassLoader
- Throws:
ClassNotFoundException
-
-