类 DefaultNamingPolicy
java.lang.Object
cn.taketoday.bytecode.core.DefaultNamingPolicy
- 所有已实现的接口:
NamingPolicy
The default policy used by
AbstractClassGenerator. Generates names
such as
cn.taketoday.bytecode.Foo$$ByTODAY$$38272841
This is composed of a prefix based on the name of the superclass, a fixed
string incorporating the CGLIB class responsible for generation, and a
hashcode derived from the parameters used to create the object. If the same
name has been previously been used in the same ClassLoader, a
suffix is added to ensure uniqueness.
- 作者:
- Harry Yang
-
嵌套类概要
从接口继承的嵌套类/接口 cn.taketoday.bytecode.core.NamingPolicy
NamingPolicy.InfraNamingPolicy -
字段概要
字段修饰符和类型字段说明static final DefaultNamingPolicyprivate static final booleanThis allows to test collisions ofkey.hashCode(). -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanTheNamingPolicyin 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.Choose a name for a generated class.protected StringgetTag()Returns a string which is incorporated into every generated class name.inthashCode()
-
字段详细资料
-
INSTANCE
-
STRESS_HASH_CODE
private static final boolean STRESS_HASH_CODEThis allows to test collisions ofkey.hashCode().
-
-
构造器详细资料
-
DefaultNamingPolicy
public DefaultNamingPolicy()
-
-
方法详细资料
-
getClassName
从接口复制的说明:NamingPolicyChoose a name for a generated class.- 指定者:
getClassName在接口中NamingPolicy- 参数:
prefix- a dotted-name chosen by the generating class (possibly to put the generated class in a particular package)source- the class simple name of the generating classkey- 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 incorporateskey.hashCode()into the class name.names- a predicate that returns true if the given classname has already been used in the same ClassLoader.- 返回:
- the fully-qualified class name
-
getTag
Returns a string which is incorporated into every generated class name. By default returns "ByTODAY" -
hashCode
public int hashCode() -
equals
从接口复制的说明:NamingPolicyTheNamingPolicyin 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.- 指定者:
equals在接口中NamingPolicy- 覆盖:
equals在类中Object
-