Package org.hotswap.agent.javassist
Class Loader.Simple
- java.lang.Object
-
- java.lang.ClassLoader
-
- org.hotswap.agent.javassist.Loader.Simple
-
- Enclosing class:
- Loader
public static class Loader.Simple extends ClassLoader
A simpler class loader. This is a class loader that exposes the protecteddefineClass()method declared injava.lang.ClassLoader. It provides a method similar toCtClass#toClass().When loading a class, this class loader delegates the work to the parent class loader unless the loaded classes are explicitly given by
invokeDefineClass(CtClass). Note that a classFooloaded by this class loader is different from the class with the same nameFoobut loaded by another class loader. This is Java's naming rule.- Since:
- 3.24
-
-
Constructor Summary
Constructors Constructor Description Simple()Constructs a class loader.Simple(ClassLoader parent)Constructs a class loader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>invokeDefineClass(CtClass cc)Invokes the protecteddefineClass()inClassLoader.-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, 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
-
Simple
public Simple()
Constructs a class loader.
-
Simple
public Simple(ClassLoader parent)
Constructs a class loader.- Parameters:
parent- the parent class loader.
-
-
Method Detail
-
invokeDefineClass
public Class<?> invokeDefineClass(CtClass cc) throws IOException, CannotCompileException
Invokes the protecteddefineClass()inClassLoader. It converts the givenCtClassobject into ajava.lang.Classobject.- Throws:
IOExceptionCannotCompileException
-
-