Package org.springframework.cglib.core
Class ClassLoaderAwareGeneratorStrategy
java.lang.Object
org.springframework.cglib.core.DefaultGeneratorStrategy
org.springframework.cglib.core.ClassLoaderAwareGeneratorStrategy
- All Implemented Interfaces:
GeneratorStrategy
CGLIB GeneratorStrategy variant which exposes the application ClassLoader
as current thread context ClassLoader for the time of class generation.
The ASM ClassWriter in Spring's ASM variant will pick it up when doing
common superclass resolution.
- Since:
- 5.2
- Author:
- Juergen Hoeller
-
Field Summary
Fields inherited from class org.springframework.cglib.core.DefaultGeneratorStrategy
INSTANCE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.springframework.cglib.core.DefaultGeneratorStrategy
getClassVisitor, getClassWriter, transform, transformMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.cglib.core.GeneratorStrategy
equals
-
Constructor Details
-
ClassLoaderAwareGeneratorStrategy
-
-
Method Details
-
generate
Description copied from interface:GeneratorStrategyGenerate the class.- Specified by:
generatein interfaceGeneratorStrategy- Overrides:
generatein classDefaultGeneratorStrategy- Parameters:
cg- a class generator on which you can callClassGenerator.generateClass(org.springframework.asm.ClassVisitor)- Returns:
- a byte array containing the bits of a valid Class
- Throws:
Exception
-