Package org.springframework.cglib.core
Interface GeneratorStrategy
- All Known Implementing Classes:
ClassLoaderAwareGeneratorStrategy,DefaultGeneratorStrategy,UndeclaredThrowableStrategy
public interface GeneratorStrategy
The
GeneratorStrategy is responsible for taking a
ClassGenerator and producing a byte array containing the
data for the generated Class. By providing your
own strategy you may examine or modify the generated class before
it is loaded. Typically this will be accomplished by subclassing
DefaultGeneratorStrategy and overriding the appropriate
protected method.-
Method Summary
Modifier and TypeMethodDescriptionbooleanTheGeneratorStrategyin use does not currently, but may in the future, affect the caching of classes generated byAbstractClassGenerator, so this is a reminder that you should correctly implementequalsandhashCodeto avoid generating too many classes.byte[]Generate the class.
-
Method Details
-
generate
Generate the class.- 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
-
equals
TheGeneratorStrategyin use does not currently, but may in the future, affect the caching of classes generated byAbstractClassGenerator, so this is a reminder that you should correctly implementequalsandhashCodeto avoid generating too many classes.
-