public interface GeneratorStrategy
GeneratorStrategyClassGenerator
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.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
The
GeneratorStrategy in use does not currently, but may
in the future, affect the caching of classes generated by AbstractClassGenerator , so this is a reminder that you should
correctly implement equals and hashCode
to avoid generating too many classes. |
byte[] |
generate(ClassGenerator cg)
Generate the class.
|
byte[] generate(ClassGenerator cg) throws Exception
cg
- a class generator on which you can call ClassGenerator.generateClass(org.mockito.asm.ClassVisitor)
Exception
boolean equals(Object o)
GeneratorStrategy
in use does not currently, but may
in the future, affect the caching of classes generated by AbstractClassGenerator
, so this is a reminder that you should
correctly implement equals
and hashCode
to avoid generating too many classes.Copyright © 2016. All rights reserved.