public class MyClassLoader
extends java.lang.ClassLoader
Modifier and Type | Field and Description |
---|---|
protected boolean |
_cfgUseParentLoader
Flag that determines if we should first try to load new class
using parent class loader or not; this may be done to try to
force access to protected/package-access properties.
|
private static java.nio.charset.Charset |
UTF8 |
Constructor and Description |
---|
MyClassLoader(java.lang.ClassLoader parent,
boolean tryToUseParent) |
Modifier and Type | Method and Description |
---|---|
static boolean |
canAddClassInPackageOf(java.lang.Class<?> cls)
Helper method called to check whether it is acceptable to create a new
class in package that given class is part of.
|
java.lang.Class<?> |
loadAndResolve(ClassName className,
byte[] byteCode) |
static int |
replaceName(byte[] byteCode,
java.lang.String from,
java.lang.String to) |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
private static final java.nio.charset.Charset UTF8
protected final boolean _cfgUseParentLoader
public MyClassLoader(java.lang.ClassLoader parent, boolean tryToUseParent)
public static boolean canAddClassInPackageOf(java.lang.Class<?> cls)
public java.lang.Class<?> loadAndResolve(ClassName className, byte[] byteCode) throws java.lang.IllegalArgumentException
className
- Interface or abstract class that class to load should extend or
implementjava.lang.IllegalArgumentException
public static int replaceName(byte[] byteCode, java.lang.String from, java.lang.String to)