Package org.springframework.core
Interface AliasRegistry
- All Known Subinterfaces:
BeanDefinitionRegistry
- All Known Implementing Classes:
AbstractAutowireCapableBeanFactory
,AbstractBeanFactory
,AnnotationConfigApplicationContext
,DefaultListableBeanFactory
,DefaultSingletonBeanRegistry
,FactoryBeanRegistrySupport
,GenericApplicationContext
,GenericGroovyApplicationContext
,GenericWebApplicationContext
,GenericXmlApplicationContext
,SimpleAliasRegistry
,SimpleBeanDefinitionRegistry
,StaticApplicationContext
,StaticWebApplicationContext
public interface AliasRegistry
Common interface for managing aliases. Serves as a super-interface for
BeanDefinitionRegistry
.- Since:
- 2.5.2
- Author:
- Juergen Hoeller
-
Method Summary
Modifier and TypeMethodDescriptionString[]
getAliases
(String name) Return the aliases for the given name, if defined.boolean
Determine whether the given name is defined as an alias (as opposed to the name of an actually registered component).void
registerAlias
(String name, String alias) Given a name, register an alias for it.void
removeAlias
(String alias) Remove the specified alias from this registry.
-
Method Details
-
registerAlias
Given a name, register an alias for it.- Parameters:
name
- the canonical namealias
- the alias to be registered- Throws:
IllegalStateException
- if the alias is already in use and may not be overridden
-
removeAlias
Remove the specified alias from this registry.- Parameters:
alias
- the alias to remove- Throws:
IllegalStateException
- if no such alias was found
-
isAlias
Determine whether the given name is defined as an alias (as opposed to the name of an actually registered component).- Parameters:
name
- the name to check- Returns:
- whether the given name is an alias
-
getAliases
Return the aliases for the given name, if defined.- Parameters:
name
- the name to check for aliases- Returns:
- the aliases, or an empty array if none
-