类 BytecodeCompiler
java.lang.Object
cn.taketoday.bytecode.BytecodeCompiler
- 直接已知子类:
SpelCompiler
- 从以下版本开始:
- 4.0 2021/11/29 11:23
- 作者:
- Harry Yang
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明<T> Class<T>compile(byte[] classFile) <T> Class<T>static BytecodeCompilergetCompiler(ClassLoader classLoader) Factory method for compiler instances.protected <T> Class<T>Load a class.
-
字段详细资料
-
childClassLoader
protected volatile cn.taketoday.bytecode.BytecodeCompiler.ChildClassLoader childClassLoader
-
-
构造器详细资料
-
BytecodeCompiler
-
-
方法详细资料
-
compile
- 类型参数:
T- class type- 参数:
className- class full name like 'cn.taketoday.xxx'classFile- class byte-code data- 返回:
- Class
-
compile
- 类型参数:
T- class type- 参数:
classFile- class byte-code data- 返回:
- Class
-
loadClass
Load a class. Makes sure the classloaders aren't used too much because they anchor compiled classes in memory and prevent GC. If you have expressions continually recompiling over time then by replacing the classloader periodically at least some of the older variants can be garbage collected.- 参数:
name- the name of the classclassFile- the bytecode for the class- 返回:
- the Class object for the compiled expression
-
getCompiler
Factory method for compiler instances. The returned BytecodeCompiler will attach a class loader as the child of the given class loader and this child will be used to load compiled expressions.- 参数:
classLoader- the ClassLoader to use as the basis for compilation- 返回:
- a corresponding BytecodeCompiler instance
-