类 DefaultAliasRegistry

java.lang.Object
cn.taketoday.core.DefaultAliasRegistry
所有已实现的接口:
AliasRegistry
直接已知子类:
StandardTypeLocator

public class DefaultAliasRegistry extends Object implements AliasRegistry
Simple implementation of the AliasRegistry interface.

Serves as base class for cn.taketoday.beans.factory.support.BeanDefinitionRegistry implementations.

从以下版本开始:
4.0 2021/9/30 22:40
作者:
Juergen Hoeller, Qimiao Chen, Harry Yang
  • 字段详细资料

    • log

      protected final Logger log
      Logger available to subclasses.
    • aliasMap

      private final ConcurrentHashMap<String,String> aliasMap
      Map from alias to canonical name.
    • aliasNames

      private final ArrayList<String> aliasNames
      List of alias names, in registration order.
  • 构造器详细资料

    • DefaultAliasRegistry

      public DefaultAliasRegistry()
  • 方法详细资料

    • registerAlias

      public void registerAlias(String name, String alias)
      从接口复制的说明: AliasRegistry
      Given a name, register an alias for it.
      指定者:
      registerAlias 在接口中 AliasRegistry
      参数:
      name - the canonical name
      alias - the alias to be registered
    • allowAliasOverriding

      protected boolean allowAliasOverriding()
      Determine whether alias overriding is allowed.

      Default is true.

    • hasAlias

      public boolean hasAlias(String name, String alias)
      Determine whether the given name has the given alias registered.
      参数:
      name - the name to check
      alias - the alias to look for
    • removeAlias

      public void removeAlias(String alias)
      从接口复制的说明: AliasRegistry
      Remove the specified alias from this registry.
      指定者:
      removeAlias 在接口中 AliasRegistry
      参数:
      alias - the alias to remove
    • isAlias

      public boolean isAlias(String name)
      从接口复制的说明: AliasRegistry
      Determine whether the given name is defined 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)
      从接口复制的说明: AliasRegistry
      Return 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
    • getAliasList

      public List<String> getAliasList(String name)
      从接口复制的说明: AliasRegistry
      Return the aliases list for the given name, if defined.
      指定者:
      getAliasList 在接口中 AliasRegistry
      参数:
      name - the name to check for aliases
      返回:
      the aliases, or an empty array-list if none
    • retrieveAliases

      private void retrieveAliases(String name, ArrayList<String> result)
      Transitively retrieve all aliases for the given name.
      参数:
      name - the target name to find aliases for
      result - the resulting aliases list
    • resolveAliases

      public void resolveAliases(StringValueResolver valueResolver)
      Resolve all alias target names and aliases registered in this registry, 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 name
      alias - the candidate alias
      另请参阅:
    • canonicalName

      public String canonicalName(String name)
      Determine the raw name, resolving aliases to canonical names.
      参数:
      name - the user-specified name
      返回:
      the transformed name