Package javassist
Class Loader.Simple
java.lang.Object
java.lang.ClassLoader
javassist.Loader.Simple
- Enclosing class:
Loader
A simpler class loader.
This is a class loader that exposes the protected
defineClass()
method
declared in java.lang.ClassLoader
. It provides a method similar to
CtClass#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 class Foo
loaded by this class loader is
different from the class with the same name Foo
but loaded by
another class loader. This is Java's naming rule.
- Since:
- 3.24
-
Constructor Summary
ConstructorDescriptionSimple()
Constructs a class loader.Simple
(ClassLoader parent) Constructs a class loader. -
Method Summary
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
-
Constructor Details
-
Simple
public Simple()Constructs a class loader. -
Simple
Constructs a class loader.- Parameters:
parent
- the parent class loader.
-
-
Method Details
-
invokeDefineClass
Invokes the protecteddefineClass()
inClassLoader
. It converts the givenCtClass
object into ajava.lang.Class
object.- Throws:
IOException
CannotCompileException
-