Package javassist
Class Loader.Simple
- java.lang.Object
-
- java.lang.ClassLoader
-
- javassist.Loader.Simple
-
- Enclosing class:
- Loader
public static class Loader.Simple extends java.lang.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 classFoo
loaded by this class loader is different from the class with the same nameFoo
but loaded by another class loader. This is Java's naming rule.- Since:
- 3.24
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>
invokeDefineClass(CtClass cc)
Invokes the protecteddefineClass()
inClassLoader
.-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, getDefinedPackage, getDefinedPackages, getName, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
-
-
-
-
Method Detail
-
invokeDefineClass
public java.lang.Class<?> invokeDefineClass(CtClass cc) throws java.io.IOException, CannotCompileException
Invokes the protecteddefineClass()
inClassLoader
. It converts the givenCtClass
object into ajava.lang.Class
object.- Throws:
java.io.IOException
CannotCompileException
-
-