Package net.sf.cglib.core
Interface GeneratorStrategy
-
- All Known Implementing Classes:
DefaultGeneratorStrategy,UndeclaredThrowableStrategy
public interface GeneratorStrategyTheGeneratorStrategyClassGeneratorand producing a byte array containing the data for the generatedClass. By providing your own strategy you may examine or modify the generated class before it is loaded. Typically this will be accomplished by subclassingDefaultGeneratorStrategyand overriding the appropriate protected method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanequals(java.lang.Object o)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.byte[]generate(ClassGenerator cg)Generate the class.
-
-
-
Method Detail
-
generate
byte[] generate(ClassGenerator cg) throws java.lang.Exception
Generate the class.- Parameters:
cg- a class generator on which you can callClassGenerator.generateClass(org.objectweb.asm.ClassVisitor)- Returns:
- a byte array containing the bits of a valid Class
- Throws:
java.lang.Exception
-
equals
boolean equals(java.lang.Object o)
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.- Overrides:
equalsin classjava.lang.Object
-
-