public class ByteArrayClassLoader extends ClassLoader
ClassLoader
allows for the loading of a set of Java classes provided in class file format.Constructor and Description |
---|
ByteArrayClassLoader(Map<String,byte[]> classes)
The given
Map of classes must not be modified afterwards. |
ByteArrayClassLoader(Map<String,byte[]> classes,
ClassLoader parent) |
Modifier and Type | Method and Description |
---|---|
protected Class<?> |
findClass(String name)
Implements
ClassLoader.findClass(String) . |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public ByteArrayClassLoader(Map<String,byte[]> classes)
Map
of classes must not be modified afterwards.classes
- String className => byte[] data, or String classFileName => byte[] datapublic ByteArrayClassLoader(Map<String,byte[]> classes, ClassLoader parent)
classes
- String className
=> byte[] data
, or String classFileName
=> byte[] data
protected Class<?> findClass(@Nullable String name) throws ClassNotFoundException
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
.
findClass
in class ClassLoader
ClassNotFoundException
Copyright © 2021. All rights reserved.