Top Description Methods
org.springframework.cglib.core

public Interface NamingPolicy

Known Direct Implementers
org.springframework.cglib.core.SpringNamingPolicy, org.springframework.cglib.core.DefaultNamingPolicy

Customize the generated class name for AbstractClassGenerator-based utilities.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object o)

The NamingPolicy 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 String

Returns:

the fully-qualified class name
getClassName
(String
a dotted-name chosen by the generating class (possibly to put the generated class in a particular package)
prefix
,
String
the fully-qualified class name of the generating class (for example "org.springframework.cglib.Enhancer")
source
,
Object
A key object representing the state of the parameters; for caching to work properly, equal keys should result in the same generated class name. The default policy incorporates key.hashCode() into the class name.
key
,
Predicate
a predicate that returns true if the given classname has already been used in the same ClassLoader.
names
)

Choose a name for a generated class.

Method Detail

equalsback to summary
public boolean equals(Object o)

The NamingPolicy 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
getClassNameback to summary
public String getClassName(String prefix, String source, Object key, Predicate names)

Choose a name for a generated class.

Parameters
prefix:String

a dotted-name chosen by the generating class (possibly to put the generated class in a particular package)

source:String

the fully-qualified class name of the generating class (for example "org.springframework.cglib.Enhancer")

key:Object

A key object representing the state of the parameters; for caching to work properly, equal keys should result in the same generated class name. The default policy incorporates key.hashCode() into the class name.

names:Predicate

a predicate that returns true if the given classname has already been used in the same ClassLoader.

Returns:String

the fully-qualified class name