public class

SimpleAliasRegistry

extends Object
implements AliasRegistry
java.lang.Object
   ↳ org.springframework.core.SimpleAliasRegistry
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Simple implementation of the AliasRegistry interface. Serves as base class for BeanDefinitionRegistry implementations.

Summary

Public Constructors
SimpleAliasRegistry()
Public Methods
String canonicalName(String name)
Determine the raw name, resolving aliases to canonical names.
String[] getAliases(String name)
Return the aliases for the given name, if defined.
boolean isAlias(String name)
Determine whether this given name is defines 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.
void resolveAliases(StringValueResolver valueResolver)
Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.
Protected Methods
boolean allowAliasOverriding()
Return whether alias overriding is allowed.
void checkForAliasCircle(String name, String alias)
Check whether the given name points back to given alias as an alias in the other direction, catching a circular reference upfront and throwing a corresponding IllegalStateException.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.core.AliasRegistry

Public Constructors

public SimpleAliasRegistry ()

Also: SpringCore

Public Methods

public String canonicalName (String name)

Also: SpringCore

Determine the raw name, resolving aliases to canonical names.

Parameters
name the user-specified name
Returns
  • the transformed name

public String[] getAliases (String name)

Also: SpringCore

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

public boolean isAlias (String name)

Also: SpringCore

Determine whether this given name is defines as an alias (as opposed to the name of an actually registered component).

Parameters
name the bean name to check
Returns
  • whether the given name is an alias

public void registerAlias (String name, String alias)

Also: SpringCore

Given a name, register an alias for it.

Parameters
name the canonical name
alias the alias to be registered

public void removeAlias (String alias)

Also: SpringCore

Remove the specified alias from this registry.

Parameters
alias the alias to remove

public void resolveAliases (StringValueResolver valueResolver)

Also: SpringCore

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.

Parameters
valueResolver the StringValueResolver to apply

Protected Methods

protected boolean allowAliasOverriding ()

Also: SpringCore

Return whether alias overriding is allowed. Default is true.

protected void checkForAliasCircle (String name, String alias)

Also: SpringCore

Check whether the given name points back to given alias as an alias in the other direction, catching a circular reference upfront and throwing a corresponding IllegalStateException.

Parameters
name the candidate name
alias the candidate alias