abstractpublic class AbstractClassGenerator implements ClassGenerator(Code)
Abstract class for all code-generating CGLIB utilities.
In addition to caching generated classes for performance, it provides hooks for
customizing the ClassLoader, name of the generated class, and transformations
applied before generation.
public void setAttemptLoad(boolean attemptLoad)(Code)
If set, CGLIB will attempt to load classes from the specified
ClassLoader before generating them. Because generated
class names are not guaranteed to be unique, the default is false.
Set the ClassLoader in which the class will be generated.
Concrete subclasses of AbstractClassGenerator (such as Enhancer)
will try to choose an appropriate default if this is unset.
Classes are cached per-ClassLoader using a WeakHashMap, to allow
the generated classes to be removed when the associated loader is garbage collected.
Parameters: classLoader - the loader to generate the new class with, or null to use the default