Package net.minidev.asm
Class DynamicClassLoader
java.lang.Object
java.lang.ClassLoader
net.minidev.asm.DynamicClassLoader
Simple extension from ClassLoader overiding the loadClass(String name,
boolean resolve) method and allowing to register new classes
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Class
<?> defineClass
(String name, byte[] bytes) Call defineClass into the parent classLoader using the method.setAccessible(boolean) hackstatic <T> T
directInstance
(Class<? extends T> parent, String clsName, byte[] clsData) static <T> Class
<T> directLoad
(Class<? extends T> parent, String clsName, byte[] clsData) protected Class
<?> Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Field Details
-
BEAN_AC
-
DEF_CLASS_SIG
Predefined define defineClass method signature (name, bytes, offset, length)
-
-
Constructor Details
-
DynamicClassLoader
DynamicClassLoader(ClassLoader parent)
-
-
Method Details
-
directLoad
- Parameters:
parent
- used to choose the ClassLoaderclsName
- CclsData
-- Returns:
-
directInstance
public static <T> T directInstance(Class<? extends T> parent, String clsName, byte[] clsData) throws InstantiationException, IllegalAccessException -
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
defineClass
Call defineClass into the parent classLoader using the method.setAccessible(boolean) hack- Throws:
ClassFormatError
- See Also:
-