类 SimpleAliasRegistry
- java.lang.Object
- org.springframework.core.SimpleAliasRegistry
- 所有已实现的接口:
AliasRegistry
public class SimpleAliasRegistry extends Object implements AliasRegistry
Simple implementation of theAliasRegistryinterface. Serves as base class forBeanDefinitionRegistryimplementations.- 从以下版本开始:
- 2.5.2
- 作者:
- Juergen Hoeller
构造器概要
构造器 构造器 说明 SimpleAliasRegistry()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected booleanallowAliasOverriding()Return whether alias overriding is allowed.StringcanonicalName(String name)Determine the raw name, resolving aliases to canonical names.protected voidcheckForAliasCircle(String name, String alias)Check whether the given name points back to the given alias as an alias in the other direction already, catching a circular reference upfront and throwing a corresponding IllegalStateException.String[]getAliases(String name)Return the aliases for the given name, if defined.booleanhasAlias(String name, String alias)Determine whether the given name has the given alias registered.booleanisAlias(String name)Determine whether this given name is defines as an alias (as opposed to the name of an actually registered component).voidregisterAlias(String name, String alias)Given a name, register an alias for it.voidremoveAlias(String alias)Remove the specified alias from this registry.voidresolveAliases(StringValueResolver valueResolver)Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.
构造器详细资料
SimpleAliasRegistry
public SimpleAliasRegistry()
方法详细资料
registerAlias
public void registerAlias(String name, String alias)
从接口复制的说明:AliasRegistryGiven a name, register an alias for it.- 指定者:
registerAlias在接口中AliasRegistry- 参数:
name- the canonical namealias- the alias to be registered
allowAliasOverriding
protected boolean allowAliasOverriding()
Return whether alias overriding is allowed. Default istrue.
hasAlias
public boolean hasAlias(String name, String alias)
Determine whether the given name has the given alias registered.- 参数:
name- the name to checkalias- the alias to look for- 从以下版本开始:
- 4.2.1
removeAlias
public void removeAlias(String alias)
从接口复制的说明:AliasRegistryRemove the specified alias from this registry.- 指定者:
removeAlias在接口中AliasRegistry- 参数:
alias- the alias to remove
isAlias
public boolean isAlias(String name)
从接口复制的说明:AliasRegistryDetermine whether this given name is defines as an alias (as opposed to the name of an actually registered component).- 指定者:
isAlias在接口中AliasRegistry- 参数:
name- the name to check- 返回:
- whether the given name is an alias
getAliases
public String[] getAliases(String name)
从接口复制的说明:AliasRegistryReturn the aliases for the given name, if defined.- 指定者:
getAliases在接口中AliasRegistry- 参数:
name- the name to check for aliases- 返回:
- the aliases, or an empty array if none
resolveAliases
public void resolveAliases(StringValueResolver valueResolver)
Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.The value resolver may for example resolve placeholders in target bean names and even in alias names.
- 参数:
valueResolver- the StringValueResolver to apply
checkForAliasCircle
protected void checkForAliasCircle(String name, String alias)
Check whether the given name points back to the given alias as an alias in the other direction already, catching a circular reference upfront and throwing a corresponding IllegalStateException.- 参数:
name- the candidate namealias- the candidate alias- 另请参阅:
registerAlias(java.lang.String, java.lang.String),hasAlias(java.lang.String, java.lang.String)
canonicalName
public String canonicalName(String name)
Determine the raw name, resolving aliases to canonical names.- 参数:
name- the user-specified name- 返回:
- the transformed name