Package org.springframework.core
Class SimpleAliasRegistry
java.lang.Object
org.springframework.core.SimpleAliasRegistry
- All Implemented Interfaces:
- AliasRegistry
- Direct Known Subclasses:
- DefaultSingletonBeanRegistry,- SimpleBeanDefinitionRegistry
Simple implementation of the 
AliasRegistry interface.
 Serves as base class for
 BeanDefinitionRegistry
 implementations.
- Since:
- 2.5.2
- Author:
- Juergen Hoeller, Qimiao Chen
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanDetermine whether alias overriding is allowed.canonicalName(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.booleanDetermine whether the given name has the given alias registered.booleanDetermine whether the given name is defined 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 registry, applying the givenStringValueResolverto them.
- 
Field Details- 
loggerLogger available to subclasses.
 
- 
- 
Constructor Details- 
SimpleAliasRegistrypublic SimpleAliasRegistry()
 
- 
- 
Method Details- 
registerAliasDescription copied from interface:AliasRegistryGiven a name, register an alias for it.- Specified by:
- registerAliasin interface- AliasRegistry
- Parameters:
- name- the canonical name
- alias- the alias to be registered
 
- 
allowAliasOverridingprotected boolean allowAliasOverriding()Determine whether alias overriding is allowed.Default is true.
- 
hasAliasDetermine whether the given name has the given alias registered.- Parameters:
- name- the name to check
- alias- the alias to look for
- Since:
- 4.2.1
 
- 
removeAliasDescription copied from interface:AliasRegistryRemove the specified alias from this registry.- Specified by:
- removeAliasin interface- AliasRegistry
- Parameters:
- alias- the alias to remove
 
- 
isAliasDescription copied from interface:AliasRegistryDetermine whether the given name is defined as an alias (as opposed to the name of an actually registered component).- Specified by:
- isAliasin interface- AliasRegistry
- Parameters:
- name- the name to check
- Returns:
- whether the given name is an alias
 
- 
getAliasesDescription copied from interface:AliasRegistryReturn the aliases for the given name, if defined.- Specified by:
- getAliasesin interface- AliasRegistry
- Parameters:
- name- the name to check for aliases
- Returns:
- the aliases, or an empty array if none
 
- 
resolveAliasesResolve all alias target names and aliases registered in this registry, applying the givenStringValueResolverto them.The value resolver may for example resolve placeholders in target bean names and even in alias names. - Parameters:
- valueResolver- the StringValueResolver to apply
 
- 
checkForAliasCircleCheck 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.- Parameters:
- name- the candidate name
- alias- the candidate alias
- See Also:
 
- 
canonicalNameDetermine the raw name, resolving aliases to canonical names.- Parameters:
- name- the user-specified name
- Returns:
- the transformed name
 
 
-