Top Description Methods
org.springframework.cglib.core

public Interface GeneratorStrategy

Known Direct Implementers
org.springframework.cglib.core.DefaultGeneratorStrategy

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.
See Also
AbstractClassGenerator#setStrategy

Method Summary

Modifier and TypeMethod and Description
public 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.

public byte[]

Returns:

a byte array containing the bits of a valid Class
generate
(ClassGenerator
a class generator on which you can call ClassGenerator#generateClass
cg
)

Generate the class.

Method Detail

equalsback to summary
public 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.

Annotations
@Override
generateback to summary
public byte[] generate(ClassGenerator cg) throws Exception

Generate the class.

Parameters
cg:ClassGenerator

a class generator on which you can call ClassGenerator#generateClass

Returns:byte[]

a byte array containing the bits of a valid Class