org.springframework.beans.factory.support

## 类 AbstractBeanFactory

- java.lang.Object
- - org.springframework.core.SimpleAliasRegistry
  - - org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
    - - org.springframework.beans.factory.support.FactoryBeanRegistrySupport
      - - org.springframework.beans.factory.support.AbstractBeanFactory

- 所有已实现的接口:
    BeanFactory, ConfigurableBeanFactory, SingletonBeanRegistry, HierarchicalBeanFactory, org.springframework.core.AliasRegistry
  直接已知子类:
    AbstractAutowireCapableBeanFactory

      public abstract class AbstractBeanFactory
      extends FactoryBeanRegistrySupport
      implements ConfigurableBeanFactory

  Abstract base class for `BeanFactory` implementations, providing the full capabilities of the `ConfigurableBeanFactory` SPI. Does not assume a listable bean factory: can therefore also be used as base class for bean factory implementations which obtain bean definitions from some backend resource (where bean definition access is an expensive operation).

  This class provides a singleton cache (through its base class `DefaultSingletonBeanRegistry`, singleton/prototype determination, `FactoryBean` handling, aliases, bean definition merging for child bean definitions, and bean destruction (`DisposableBean` interface, custom destroy methods). Furthermore, it can manage a bean factory hierarchy (delegating to the parent in case of an unknown bean), through implementing the `HierarchicalBeanFactory` interface.

  The main template methods to be implemented by subclasses are `getBeanDefinition(java.lang.String)` and `createBean(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Object[])`, retrieving a bean definition for a given bean name and creating a bean instance for a given bean definition, respectively. Default implementations of those operations can be found in `DefaultListableBeanFactory` and `AbstractAutowireCapableBeanFactory`.

  从以下版本开始:
    15 April 2001
  作者:
    Rod Johnson, Juergen Hoeller, Costin Leau, Chris Beams
  另请参阅:
    `getBeanDefinition(java.lang.String)`, `createBean(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.Object[])`, `AbstractAutowireCapableBeanFactory.createBean(java.lang.Class<T>)`, `DefaultListableBeanFactory.getBeanDefinition(java.lang.String)`

- - ### 字段概要

    - ### 从类继承的字段 org.springframework.core.SimpleAliasRegistry

      `logger`

    - ### 从接口继承的字段 org.springframework.beans.factory.config.ConfigurableBeanFactory

      `SCOPE_PROTOTYPE, SCOPE_SINGLETON`

    - ### 从接口继承的字段 org.springframework.beans.factory.BeanFactory

      `FACTORY_BEAN_PREFIX`

  - ### 构造器概要

    构造器
    构造器和说明
    `AbstractBeanFactory()` Create a new AbstractBeanFactory.
    `AbstractBeanFactory(BeanFactory parentBeanFactory)` Create a new AbstractBeanFactory with the given parent.

  - ### 方法概要

    所有方法 实例方法 抽象方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addBeanPostProcessor(BeanPostProcessor beanPostProcessor)` Add a new BeanPostProcessor that will get applied to beans created by this factory.
    `void` | `addEmbeddedValueResolver(org.springframework.util.StringValueResolver valueResolver)` Add a String resolver for embedded values such as annotation attributes.
    `void` | `addPropertyEditorRegistrar(PropertyEditorRegistrar registrar)` Add a PropertyEditorRegistrar to be applied to all bean creation processes.
    `protected void` | `afterPrototypeCreation(String beanName)` Callback after prototype creation.
    `protected void` | `beforePrototypeCreation(String beanName)` Callback before prototype creation.
    `protected void` | `checkMergedBeanDefinition(RootBeanDefinition mbd, String beanName, Object[] args)` Check the given merged bean definition, potentially throwing validation exceptions.
    `protected void` | `cleanupAfterBeanCreationFailure(String beanName)` Perform appropriate cleanup of cached metadata after bean creation failed.
    `protected void` | `clearMergedBeanDefinition(String beanName)` Remove the merged bean definition for the specified bean, recreating it on next access.
    `void` | `clearMetadataCache()` Clear the merged bean definition cache, removing entries for beans which are not considered eligible for full metadata caching yet.
    `boolean` | `containsBean(String name)` 判断我们的容器中是否包含了当前的bean对象
    `protected abstract boolean` | `containsBeanDefinition(String beanName)` Check if this bean factory contains a bean definition with the given name.
    `boolean` | `containsLocalBean(String name)` 本地工厂是否包含这个Bean 忽略其他所有父工厂
    `void` | `copyConfigurationFrom(ConfigurableBeanFactory otherFactory)` Copy all relevant configuration from the given other factory.
    `void` | `copyRegisteredEditorsTo(PropertyEditorRegistry registry)` Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.
    `protected abstract Object` | `createBean(String beanName, RootBeanDefinition mbd, Object[] args)` 该方法定义在 AbstractBeanFactory 中，其含义是根据给定的 BeanDefinition 和 args 实例化一个 Bean 对象。
    `void` | `destroyBean(String beanName, Object beanInstance)` Destroy the given bean instance (usually a prototype instance obtained from this factory) according to its bean definition.
    `protected void` | `destroyBean(String beanName, Object bean, RootBeanDefinition mbd)` Destroy the given bean instance (usually a prototype instance obtained from this factory) according to the given bean definition.
    `void` | `destroyScopedBean(String beanName)` Destroy the specified scoped bean in the current target scope, if any.
    `protected <T> T` | `doGetBean(String name, Class<T> requiredType, Object[] args, boolean typeCheckOnly)` 返回bean的实例,该实例可能是单例bean 也有可能是原型的bean
    `protected Object` | `evaluateBeanDefinitionString(String value, BeanDefinition beanDefinition)` Evaluate the given String as contained in a bean definition, potentially resolving it as an expression.
    `AccessControlContext` | `getAccessControlContext()` Delegate the creation of the access control context to the `SecurityContextProvider`.
    `String[]` | `getAliases(String name)` 获取bean的所有的别名 Will ask the parent factory if the bean cannot be found in this factory instance.
    `Object` | `getBean(String name)` 该方法是一个空壳方法,没有任何的实现逻辑 真正的逻辑调用在doGetBean()中 该接口是实现了BeanFactory的getBean(String name)接口
    `<T> T` | `getBean(String name, Class<T> requiredType)` 通过bean 去容器中获取一个bean对象
    `<T> T` | `getBean(String name, Class<T> requiredType, Object... args)` Return an instance, which may be shared or independent, of the specified bean.
    `Object` | `getBean(String name, Object... args)` 通过bean 去容器中获取一个bean对象
    `ClassLoader` | `getBeanClassLoader()` Return this factory's class loader for loading bean classes (only `null` if even the system ClassLoader isn't accessible).
    `protected abstract BeanDefinition` | `getBeanDefinition(String beanName)` Return the bean definition for the given bean name.
    `BeanExpressionResolver` | `getBeanExpressionResolver()` Return the resolution strategy for expressions in bean definition values.
    `int` | `getBeanPostProcessorCount()` Return the current number of registered BeanPostProcessors, if any.
    `List<BeanPostProcessor>` | `getBeanPostProcessors()` Return the list of BeanPostProcessors that will get applied to beans created with this factory.
    `org.springframework.core.convert.ConversionService` | `getConversionService()` Return the associated ConversionService, if any.
    `Map<Class<?>,Class<? extends PropertyEditor>>` | `getCustomEditors()` Return the map of custom editors, with Classes as keys and PropertyEditor classes as values.
    `protected TypeConverter` | `getCustomTypeConverter()` Return the custom TypeConverter to use, if any.
    `BeanDefinition` | `getMergedBeanDefinition(String name)` Return a 'merged' BeanDefinition for the given bean name, merging a child bean definition with its parent if necessary.
    `protected RootBeanDefinition` | `getMergedBeanDefinition(String beanName, BeanDefinition bd)` Return a RootBeanDefinition for the given top-level bean, by merging with the parent if the given bean's definition is a child bean definition.
    `protected RootBeanDefinition` | `getMergedBeanDefinition(String beanName, BeanDefinition bd, BeanDefinition containingBd)` Return a RootBeanDefinition for the given bean, by merging with the parent if the given bean's definition is a child bean definition.
    `protected RootBeanDefinition` | `getMergedLocalBeanDefinition(String beanName)` Return a merged RootBeanDefinition, traversing the parent bean definition if the specified bean corresponds to a child bean definition.
    `protected Object` | `getObjectForBeanInstance(Object beanInstance, String name, String beanName, RootBeanDefinition mbd)` Get the object for the given bean instance, either the bean instance itself or its created object in case of a FactoryBean.
    `BeanFactory` | `getParentBeanFactory()` 返回本Bean工厂的父工厂
    `Set<PropertyEditorRegistrar>` | `getPropertyEditorRegistrars()` Return the set of PropertyEditorRegistrars.
    `Scope` | `getRegisteredScope(String scopeName)` Return the Scope implementation for the given scope name, if any.
    `String[]` | `getRegisteredScopeNames()` Return the names of all currently registered scopes.
    `ClassLoader` | `getTempClassLoader()` Return the temporary ClassLoader to use for type matching purposes, if any.
    `Class<?>` | `getType(String name)` 通过beanName获取对应bean的class类型
    `TypeConverter` | `getTypeConverter()` Obtain a type converter as used by this BeanFactory.
    `protected Class<?>` | `getTypeForFactoryBean(String beanName, RootBeanDefinition mbd)` Determine the bean type for the given FactoryBean definition, as far as possible.
    `protected boolean` | `hasBeanCreationStarted()` Check whether this factory's bean creation phase already started, i.e. whether any bean has been marked as created in the meantime.
    `protected boolean` | `hasDestructionAwareBeanPostProcessors()` Return whether this factory holds a DestructionAwareBeanPostProcessor that will get applied to singleton beans on shutdown.
    `boolean` | `hasEmbeddedValueResolver()` Determine whether an embedded value resolver has been registered with this bean factory, to be applied through `ConfigurableBeanFactory.resolveEmbeddedValue(String)`.
    `protected boolean` | `hasInstantiationAwareBeanPostProcessors()` Return whether this factory holds a InstantiationAwareBeanPostProcessor that will get applied to singleton beans on shutdown.
    `protected void` | `initBeanWrapper(BeanWrapper bw)` Initialize the given BeanWrapper with the custom editors registered with this factory.
    `boolean` | `isActuallyInCreation(String beanName)`
    `protected boolean` | `isBeanEligibleForMetadataCaching(String beanName)` Determine whether the specified bean is eligible for having its bean definition metadata cached.
    `boolean` | `isBeanNameInUse(String beanName)` Determine whether the given bean name is already in use within this factory, i.e. whether there is a local bean or alias registered under this name or an inner bean created with this name.
    `boolean` | `isCacheBeanMetadata()` Return whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
    `boolean` | `isFactoryBean(String name)` Determine whether the bean with the given name is a FactoryBean.
    `protected boolean` | `isFactoryBean(String beanName, RootBeanDefinition mbd)` Check whether the given bean is defined as a `FactoryBean`.
    `boolean` | `isPrototype(String name)` 是不是原型的
    `protected boolean` | `isPrototypeCurrentlyInCreation(String beanName)` Return whether the specified prototype bean is currently in creation (within the current thread).
    `boolean` | `isSingleton(String name)` 判断当前的bean是不是单例的
    `boolean` | `isTypeMatch(String name, Class<?> typeToMatch)` 是不是匹配的类型
    `boolean` | `isTypeMatch(String name, org.springframework.core.ResolvableType typeToMatch)` 是不是匹配的类型 Will ask the parent factory if the bean cannot be found in this factory instance.
    `protected void` | `markBeanAsCreated(String beanName)` Mark the specified bean as already created (or about to be created).
    `protected String` | `originalBeanName(String name)` 获取原始bean的name
    `protected Class<?>` | `predictBeanType(String beanName, RootBeanDefinition mbd, Class<?>... typesToMatch)` Predict the eventual bean type (of the processed bean instance) for the specified bean.
    `void` | `registerCustomEditor(Class<?> requiredType, Class<? extends PropertyEditor> propertyEditorClass)` Register the given custom property editor for all properties of the given type.
    `protected void` | `registerCustomEditors(PropertyEditorRegistry registry)` Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.
    `protected void` | `registerDisposableBeanIfNecessary(String beanName, Object bean, RootBeanDefinition mbd)` Add the given bean to the list of disposable beans in this factory, registering its DisposableBean interface and/or the given destroy method to be called on factory shutdown (if applicable).
    `void` | `registerScope(String scopeName, Scope scope)` Register the given scope, backed by the given Scope implementation.
    `protected boolean` | `removeSingletonIfCreatedForTypeCheckOnly(String beanName)` Remove the singleton instance (if any) for the given bean name, but only if it hasn't been used for other purposes than type checking.
    `protected boolean` | `requiresDestruction(Object bean, RootBeanDefinition mbd)` Determine whether the given bean requires destruction on shutdown.
    `protected Class<?>` | `resolveBeanClass(RootBeanDefinition mbd, String beanName, Class<?>... typesToMatch)` Resolve the bean class for the specified bean definition, resolving a bean class name into a Class reference (if necessary) and storing the resolved Class in the bean definition for further use.
    `String` | `resolveEmbeddedValue(String value)` Resolve the given embedded value, e.g. an annotation attribute.
    `void` | `setBeanClassLoader(ClassLoader beanClassLoader)` Set the class loader to use for loading bean classes.
    `void` | `setBeanExpressionResolver(BeanExpressionResolver resolver)` Specify the resolution strategy for expressions in bean definition values.
    `void` | `setCacheBeanMetadata(boolean cacheBeanMetadata)` Set whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
    `void` | `setConversionService(org.springframework.core.convert.ConversionService conversionService)` Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
    `void` | `setParentBeanFactory(BeanFactory parentBeanFactory)` Set the parent of this bean factory.
    `void` | `setSecurityContextProvider(SecurityContextProvider securityProvider)` Set the security context provider for this bean factory.
    `void` | `setTempClassLoader(ClassLoader tempClassLoader)` Specify a temporary ClassLoader to use for type matching purposes.
    `void` | `setTypeConverter(TypeConverter typeConverter)` Set a custom type converter that this BeanFactory should use for converting bean property values, constructor argument values, etc.
    `protected String` | `transformedBeanName(String name)` 解析别名

    - ### 从类继承的方法 org.springframework.beans.factory.support.FactoryBeanRegistrySupport

      `clearSingletonCache, getCachedObjectForFactoryBean, getFactoryBean, getObjectFromFactoryBean, getTypeForFactoryBean, postProcessObjectFromFactoryBean, removeSingleton`

    - ### 从类继承的方法 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry

      `addSingleton, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, destroySingleton, destroySingletons, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isCurrentlyInCreation, isDependent, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, registerSingleton, setCurrentlyInCreation`

    - ### 从类继承的方法 org.springframework.core.SimpleAliasRegistry

      `allowAliasOverriding, canonicalName, checkForAliasCircle, hasAlias, isAlias, registerAlias, removeAlias, resolveAliases`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### 从接口继承的方法 org.springframework.beans.factory.config.ConfigurableBeanFactory

      `destroySingletons, getDependenciesForBean, getDependentBeans, isCurrentlyInCreation, registerAlias, registerDependentBean, resolveAliases, setCurrentlyInCreation`

    - ### 从接口继承的方法 org.springframework.beans.factory.BeanFactory

      `getBean, getBean`

    - ### 从接口继承的方法 org.springframework.beans.factory.config.SingletonBeanRegistry

      `containsSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, registerSingleton`

- - ### 构造器详细资料

    - #### AbstractBeanFactory

          public AbstractBeanFactory()

      Create a new AbstractBeanFactory.

    - #### AbstractBeanFactory

          public AbstractBeanFactory(@Nullable
                                     BeanFactory parentBeanFactory)

      Create a new AbstractBeanFactory with the given parent.
      参数:
        `parentBeanFactory` - parent bean factory, or `null` if none
      另请参阅:
        `getBean(java.lang.String)`

  - ### 方法详细资料

    - #### getBean

          public Object getBean(String name)
                         throws BeansException

      该方法是一个空壳方法,没有任何的实现逻辑 真正的逻辑调用在doGetBean()中 该接口是实现了BeanFactory的getBean(String name)接口
      指定者:
        `getBean` 在接口中 `BeanFactory`
      参数:
        `name` - bean的名称 该名称也有可能是bean的alies(别名)
      返回:
        我们的单例对象
      抛出:
        `BeansException`
        `NoSuchBeanDefinitionException` - 抛出的异常，容器中没有该bean的定义

    - #### getBean

          public <T> T getBean(String name,
                               @Nullable
                               Class<T> requiredType)
                        throws BeansException

      从接口复制的说明: `BeanFactory`
      通过bean 去容器中获取一个bean对象
      指定者:
        `getBean` 在接口中 `BeanFactory`
      参数:
        `name` - 名称(有可能是bean的真正的名称 也有可能是工厂bean的名称 也有可能是bean的别名)
        `requiredType` - 去容器中获取Bean的class类型 可以是实现的接口和父类
      返回:
        返回Bean对应的实例
      抛出:
        `NoSuchBeanDefinitionException` - 抛出的异常，容器中没有该bean的定义
        `BeanNotOfRequiredTypeException` - 容器中没有指定class类型的bean
        `BeansException` - bean还没有被创建

    - #### getBean

          public Object getBean(String name,
                                Object... args)
                         throws BeansException

      从接口复制的说明: `BeanFactory`
      通过bean 去容器中获取一个bean对象
      指定者:
        `getBean` 在接口中 `BeanFactory`
      参数:
        `name` - 名称(有可能是bean的真正的名称 也有可能是工厂bean的名称 也有可能是bean的别名)
        `args` - 这个是用于指定传入获取bean的构造函数的参数,通过传入该参数，那么就可以明确的知道去调用哪个构造函数是实例化对象
      返回:
        返回Bean对应的实例
      抛出:
        `NoSuchBeanDefinitionException` - 抛出的异常，容器中没有该bean的定义
        `BeanDefinitionStoreException` - 主要用于多例模式下的构造器创建？？？？暂时没理解
        `BeansException` - bean还没有被创建

    - #### getBean

          public <T> T getBean(String name,
                               @Nullable
                               Class<T> requiredType,
                               @Nullable
                               Object... args)
                        throws BeansException

      Return an instance, which may be shared or independent, of the specified bean.
      参数:
        `name` - the name of the bean to retrieve
        `requiredType` - the required type of the bean to retrieve
        `args` - arguments to use when creating a bean instance using explicit arguments (only applied when creating a new instance as opposed to retrieving an existing one)
      返回:
        an instance of the bean
      抛出:
        `BeansException` - if the bean could not be created

    - #### doGetBean

          protected <T> T doGetBean(String name,
                                    @Nullable
                                    Class<T> requiredType,
                                    @Nullable
                                    Object[] args,
                                    boolean typeCheckOnly)
                             throws BeansException

      返回bean的实例,该实例可能是单例bean 也有可能是原型的bean
      参数:
        `name` - bean的名称 也有可能是bean的别名
        `requiredType` - 需要获取bean的类型
        `args` - 通过该参数传递进来,到调用构造方法时候发现有多个构造方法,我们就可以通过该参数来指定想要的构造方法了 不需要去推断构造方法(因为推断构造方法很耗时)
        `typeCheckOnly` - 判断当前的bean是不是一个检查类型的bean 这类型用的很少.
      返回:
        返回一个bean实例
      抛出:
        `BeansException` - 如何bean不能被创建 那么就回抛出异常

    - #### containsBean

          public boolean containsBean(String name)

      从接口复制的说明: `BeanFactory`
      判断我们的容器中是否包含了当前的bean对象
      指定者:
        `containsBean` 在接口中 `BeanFactory`
      参数:
        `name` - the name of the bean to query
      返回:
        whether a bean with the given name is present

    - #### isSingleton

          public boolean isSingleton(String name)
                              throws NoSuchBeanDefinitionException

      从接口复制的说明: `BeanFactory`
      判断当前的bean是不是单例的
      指定者:
        `isSingleton` 在接口中 `BeanFactory`
      参数:
        `name` - the name of the bean to query
      返回:
        whether this bean corresponds to a singleton instance
      抛出:
        `NoSuchBeanDefinitionException` - if there is no bean with the given name
      另请参阅:
        `BeanFactory.getBean(java.lang.String)`, `BeanFactory.isPrototype(java.lang.String)`

    - #### isPrototype

          public boolean isPrototype(String name)
                              throws NoSuchBeanDefinitionException

      从接口复制的说明: `BeanFactory`
      是不是原型的
      指定者:
        `isPrototype` 在接口中 `BeanFactory`
      参数:
        `name` - the name of the bean to query
      返回:
        whether this bean will always deliver independent instances
      抛出:
        `NoSuchBeanDefinitionException` - if there is no bean with the given name
      另请参阅:
        `BeanFactory.getBean(java.lang.String)`, `BeanFactory.isSingleton(java.lang.String)`

    - #### isTypeMatch

          public boolean isTypeMatch(String name,
                                     org.springframework.core.ResolvableType typeToMatch)
                              throws NoSuchBeanDefinitionException

      从接口复制的说明: `BeanFactory`
      是不是匹配的类型 Will ask the parent factory if the bean cannot be found in this factory instance.
      指定者:
        `isTypeMatch` 在接口中 `BeanFactory`
      参数:
        `name` - the name of the bean to query
        `typeToMatch` - the type to match against (as a `ResolvableType`)
      返回:
        `true` if the bean type matches, `false` if it doesn't match or cannot be determined yet
      抛出:
        `NoSuchBeanDefinitionException` - if there is no bean with the given name
      另请参阅:
        `BeanFactory.getBean(java.lang.String)`, `BeanFactory.getType(java.lang.String)`

    - #### isTypeMatch

          public boolean isTypeMatch(String name,
                                     @Nullable
                                     Class<?> typeToMatch)
                              throws NoSuchBeanDefinitionException

      从接口复制的说明: `BeanFactory`
      是不是匹配的类型
      指定者:
        `isTypeMatch` 在接口中 `BeanFactory`
      参数:
        `name` - the name of the bean to query
        `typeToMatch` - the type to match against (as a `Class`)
      返回:
        `true` if the bean type matches, `false` if it doesn't match or cannot be determined yet
      抛出:
        `NoSuchBeanDefinitionException` - if there is no bean with the given name
      另请参阅:
        `BeanFactory.getBean(java.lang.String)`, `BeanFactory.getType(java.lang.String)`

    - #### getType

          @Nullable
          public Class<?> getType(String name)
                                      throws NoSuchBeanDefinitionException

      从接口复制的说明: `BeanFactory`
      通过beanName获取对应bean的class类型
      指定者:
        `getType` 在接口中 `BeanFactory`
      参数:
        `name` - the name of the bean to query
      返回:
        the type of the bean, or `null` if not determinable
      抛出:
        `NoSuchBeanDefinitionException` - if there is no bean with the given name
      另请参阅:
        `BeanFactory.getBean(java.lang.String)`, `BeanFactory.isTypeMatch(java.lang.String, org.springframework.core.ResolvableType)`

    - #### getAliases

          public String[] getAliases(String name)

      从接口复制的说明: `BeanFactory`
      获取bean的所有的别名

      Will ask the parent factory if the bean cannot be found in this factory instance.

      指定者:
        `getAliases` 在接口中 `BeanFactory`
      指定者:
        `getAliases` 在接口中 `org.springframework.core.AliasRegistry`
      覆盖:
        `getAliases` 在类中 `org.springframework.core.SimpleAliasRegistry`
      参数:
        `name` - the bean name to check for aliases
      返回:
        the aliases, or an empty array if none
      另请参阅:
        `BeanFactory.getBean(java.lang.String)`

    - #### getParentBeanFactory

          @Nullable
          public BeanFactory getParentBeanFactory()

      从接口复制的说明: `HierarchicalBeanFactory`
      返回本Bean工厂的父工厂
      指定者:
        `getParentBeanFactory` 在接口中 `HierarchicalBeanFactory`

    - #### containsLocalBean

          public boolean containsLocalBean(String name)

      从接口复制的说明: `HierarchicalBeanFactory`
      本地工厂是否包含这个Bean 忽略其他所有父工厂
      指定者:
        `containsLocalBean` 在接口中 `HierarchicalBeanFactory`
      参数:
        `name` - the name of the bean to query
      返回:
        whether a bean with the given name is defined in the local factory
      另请参阅:
        `BeanFactory.containsBean(java.lang.String)`

    - #### setParentBeanFactory

          public void setParentBeanFactory(@Nullable
                                           BeanFactory parentBeanFactory)

      从接口复制的说明: `ConfigurableBeanFactory`
      Set the parent of this bean factory.

      Note that the parent cannot be changed: It should only be set outside a constructor if it isn't available at the time of factory instantiation.

      指定者:
        `setParentBeanFactory` 在接口中 `ConfigurableBeanFactory`
      参数:
        `parentBeanFactory` - the parent BeanFactory
      另请参阅:
        `HierarchicalBeanFactory.getParentBeanFactory()`

    - #### setBeanClassLoader

          public void setBeanClassLoader(@Nullable
                                         ClassLoader beanClassLoader)

      从接口复制的说明: `ConfigurableBeanFactory`
      Set the class loader to use for loading bean classes. Default is the thread context class loader.

      Note that this class loader will only apply to bean definitions that do not carry a resolved bean class yet. This is the case as of Spring 2.0 by default: Bean definitions only carry bean class names, to be resolved once the factory processes the bean definition.

      指定者:
        `setBeanClassLoader` 在接口中 `ConfigurableBeanFactory`
      参数:
        `beanClassLoader` - the class loader to use, or `null` to suggest the default class loader

    - #### getBeanClassLoader

          @Nullable
          public ClassLoader getBeanClassLoader()

      从接口复制的说明: `ConfigurableBeanFactory`
      Return this factory's class loader for loading bean classes (only `null` if even the system ClassLoader isn't accessible).
      指定者:
        `getBeanClassLoader` 在接口中 `ConfigurableBeanFactory`
      另请参阅:
        `ClassUtils.forName(String, ClassLoader)`

    - #### setTempClassLoader

          public void setTempClassLoader(@Nullable
                                         ClassLoader tempClassLoader)

      从接口复制的说明: `ConfigurableBeanFactory`
      Specify a temporary ClassLoader to use for type matching purposes. Default is none, simply using the standard bean ClassLoader.

      A temporary ClassLoader is usually just specified if load-time weaving is involved, to make sure that actual bean classes are loaded as lazily as possible. The temporary loader is then removed once the BeanFactory completes its bootstrap phase.

      指定者:
        `setTempClassLoader` 在接口中 `ConfigurableBeanFactory`

    - #### getTempClassLoader

          @Nullable
          public ClassLoader getTempClassLoader()

      从接口复制的说明: `ConfigurableBeanFactory`
      Return the temporary ClassLoader to use for type matching purposes, if any.
      指定者:
        `getTempClassLoader` 在接口中 `ConfigurableBeanFactory`

    - #### setCacheBeanMetadata

          public void setCacheBeanMetadata(boolean cacheBeanMetadata)

      从接口复制的说明: `ConfigurableBeanFactory`
      Set whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes. Default is on.

      Turn this flag off to enable hot-refreshing of bean definition objects and in particular bean classes. If this flag is off, any creation of a bean instance will re-query the bean class loader for newly resolved classes.

      指定者:
        `setCacheBeanMetadata` 在接口中 `ConfigurableBeanFactory`

    - #### isCacheBeanMetadata

          public boolean isCacheBeanMetadata()

      从接口复制的说明: `ConfigurableBeanFactory`
      Return whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
      指定者:
        `isCacheBeanMetadata` 在接口中 `ConfigurableBeanFactory`

    - #### setBeanExpressionResolver

          public void setBeanExpressionResolver(@Nullable
                                                BeanExpressionResolver resolver)

      从接口复制的说明: `ConfigurableBeanFactory`
      Specify the resolution strategy for expressions in bean definition values.

      There is no expression support active in a BeanFactory by default. An ApplicationContext will typically set a standard expression strategy here, supporting "#{...}" expressions in a Unified EL compatible style.

      指定者:
        `setBeanExpressionResolver` 在接口中 `ConfigurableBeanFactory`

    - #### getBeanExpressionResolver

          @Nullable
          public BeanExpressionResolver getBeanExpressionResolver()

      从接口复制的说明: `ConfigurableBeanFactory`
      Return the resolution strategy for expressions in bean definition values.
      指定者:
        `getBeanExpressionResolver` 在接口中 `ConfigurableBeanFactory`

    - #### setConversionService

          public void setConversionService(@Nullable
                                           org.springframework.core.convert.ConversionService conversionService)

      从接口复制的说明: `ConfigurableBeanFactory`
      Specify a Spring 3.0 ConversionService to use for converting property values, as an alternative to JavaBeans PropertyEditors.
      指定者:
        `setConversionService` 在接口中 `ConfigurableBeanFactory`

    - #### getConversionService

          @Nullable
          public org.springframework.core.convert.ConversionService getConversionService()

      从接口复制的说明: `ConfigurableBeanFactory`
      Return the associated ConversionService, if any.
      指定者:
        `getConversionService` 在接口中 `ConfigurableBeanFactory`

    - #### addPropertyEditorRegistrar

          public void addPropertyEditorRegistrar(PropertyEditorRegistrar registrar)

      从接口复制的说明: `ConfigurableBeanFactory`
      Add a PropertyEditorRegistrar to be applied to all bean creation processes.

      Such a registrar creates new PropertyEditor instances and registers them on the given registry, fresh for each bean creation attempt. This avoids the need for synchronization on custom editors; hence, it is generally preferable to use this method instead of `ConfigurableBeanFactory.registerCustomEditor(java.lang.Class<?>, java.lang.Class<? extends java.beans.PropertyEditor>)`.

      指定者:
        `addPropertyEditorRegistrar` 在接口中 `ConfigurableBeanFactory`
      参数:
        `registrar` - the PropertyEditorRegistrar to register

    - #### getPropertyEditorRegistrars

          public Set<PropertyEditorRegistrar> getPropertyEditorRegistrars()

      Return the set of PropertyEditorRegistrars.

    - #### registerCustomEditor

          public void registerCustomEditor(Class<?> requiredType,
                                           Class<? extends PropertyEditor> propertyEditorClass)

      从接口复制的说明: `ConfigurableBeanFactory`
      Register the given custom property editor for all properties of the given type. To be invoked during factory configuration.

      Note that this method will register a shared custom editor instance; access to that instance will be synchronized for thread-safety. It is generally preferable to use `ConfigurableBeanFactory.addPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar)` instead of this method, to avoid for the need for synchronization on custom editors.

      指定者:
        `registerCustomEditor` 在接口中 `ConfigurableBeanFactory`
      参数:
        `requiredType` - type of the property
        `propertyEditorClass` - the `PropertyEditor` class to register

    - #### copyRegisteredEditorsTo

          public void copyRegisteredEditorsTo(PropertyEditorRegistry registry)

      从接口复制的说明: `ConfigurableBeanFactory`
      Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.
      指定者:
        `copyRegisteredEditorsTo` 在接口中 `ConfigurableBeanFactory`
      参数:
        `registry` - the PropertyEditorRegistry to initialize

    - #### getCustomEditors

          public Map<Class<?>,Class<? extends PropertyEditor>> getCustomEditors()

      Return the map of custom editors, with Classes as keys and PropertyEditor classes as values.

    - #### setTypeConverter

          public void setTypeConverter(TypeConverter typeConverter)

      从接口复制的说明: `ConfigurableBeanFactory`
      Set a custom type converter that this BeanFactory should use for converting bean property values, constructor argument values, etc.

      This will override the default PropertyEditor mechanism and hence make any custom editors or custom editor registrars irrelevant.

      指定者:
        `setTypeConverter` 在接口中 `ConfigurableBeanFactory`
      另请参阅:
        `ConfigurableBeanFactory.addPropertyEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar)`, `ConfigurableBeanFactory.registerCustomEditor(java.lang.Class<?>, java.lang.Class<? extends java.beans.PropertyEditor>)`

    - #### getCustomTypeConverter

          @Nullable
          protected TypeConverter getCustomTypeConverter()

      Return the custom TypeConverter to use, if any.
      返回:
        the custom TypeConverter, or `null` if none specified

    - #### getTypeConverter

          public TypeConverter getTypeConverter()

      从接口复制的说明: `ConfigurableBeanFactory`
      Obtain a type converter as used by this BeanFactory. This may be a fresh instance for each call, since TypeConverters are usually not thread-safe.

      If the default PropertyEditor mechanism is active, the returned TypeConverter will be aware of all custom editors that have been registered.

      指定者:
        `getTypeConverter` 在接口中 `ConfigurableBeanFactory`

    - #### addEmbeddedValueResolver

          public void addEmbeddedValueResolver(org.springframework.util.StringValueResolver valueResolver)

      从接口复制的说明: `ConfigurableBeanFactory`
      Add a String resolver for embedded values such as annotation attributes.
      指定者:
        `addEmbeddedValueResolver` 在接口中 `ConfigurableBeanFactory`
      参数:
        `valueResolver` - the String resolver to apply to embedded values

    - #### hasEmbeddedValueResolver

          public boolean hasEmbeddedValueResolver()

      从接口复制的说明: `ConfigurableBeanFactory`
      Determine whether an embedded value resolver has been registered with this bean factory, to be applied through `ConfigurableBeanFactory.resolveEmbeddedValue(String)`.
      指定者:
        `hasEmbeddedValueResolver` 在接口中 `ConfigurableBeanFactory`

    - #### resolveEmbeddedValue

          @Nullable
          public String resolveEmbeddedValue(@Nullable
                                                        String value)

      从接口复制的说明: `ConfigurableBeanFactory`
      Resolve the given embedded value, e.g. an annotation attribute.
      指定者:
        `resolveEmbeddedValue` 在接口中 `ConfigurableBeanFactory`
      参数:
        `value` - the value to resolve
      返回:
        the resolved value (may be the original value as-is)

    - #### addBeanPostProcessor

          public void addBeanPostProcessor(BeanPostProcessor beanPostProcessor)

      从接口复制的说明: `ConfigurableBeanFactory`
      Add a new BeanPostProcessor that will get applied to beans created by this factory. To be invoked during factory configuration.

      Note: Post-processors submitted here will be applied in the order of registration; any ordering semantics expressed through implementing the `Ordered` interface will be ignored. Note that autodetected post-processors (e.g. as beans in an ApplicationContext) will always be applied after programmatically registered ones.

      指定者:
        `addBeanPostProcessor` 在接口中 `ConfigurableBeanFactory`
      参数:
        `beanPostProcessor` - the post-processor to register

    - #### getBeanPostProcessorCount

          public int getBeanPostProcessorCount()

      从接口复制的说明: `ConfigurableBeanFactory`
      Return the current number of registered BeanPostProcessors, if any.
      指定者:
        `getBeanPostProcessorCount` 在接口中 `ConfigurableBeanFactory`

    - #### getBeanPostProcessors

          public List<BeanPostProcessor> getBeanPostProcessors()

      Return the list of BeanPostProcessors that will get applied to beans created with this factory.

    - #### hasInstantiationAwareBeanPostProcessors

          protected boolean hasInstantiationAwareBeanPostProcessors()

      Return whether this factory holds a InstantiationAwareBeanPostProcessor that will get applied to singleton beans on shutdown.
      另请参阅:
        `addBeanPostProcessor(org.springframework.beans.factory.config.BeanPostProcessor)`, `InstantiationAwareBeanPostProcessor`

    - #### hasDestructionAwareBeanPostProcessors

          protected boolean hasDestructionAwareBeanPostProcessors()

      Return whether this factory holds a DestructionAwareBeanPostProcessor that will get applied to singleton beans on shutdown.
      另请参阅:
        `addBeanPostProcessor(org.springframework.beans.factory.config.BeanPostProcessor)`, `DestructionAwareBeanPostProcessor`

    - #### registerScope

          public void registerScope(String scopeName,
                                    Scope scope)

      从接口复制的说明: `ConfigurableBeanFactory`
      Register the given scope, backed by the given Scope implementation.
      指定者:
        `registerScope` 在接口中 `ConfigurableBeanFactory`
      参数:
        `scopeName` - the scope identifier
        `scope` - the backing Scope implementation

    - #### getRegisteredScopeNames

          public String[] getRegisteredScopeNames()

      从接口复制的说明: `ConfigurableBeanFactory`
      Return the names of all currently registered scopes.

      This will only return the names of explicitly registered scopes. Built-in scopes such as "singleton" and "prototype" won't be exposed.

      指定者:
        `getRegisteredScopeNames` 在接口中 `ConfigurableBeanFactory`
      返回:
        the array of scope names, or an empty array if none
      另请参阅:
        `ConfigurableBeanFactory.registerScope(java.lang.String, org.springframework.beans.factory.config.Scope)`

    - #### getRegisteredScope

          @Nullable
          public Scope getRegisteredScope(String scopeName)

      从接口复制的说明: `ConfigurableBeanFactory`
      Return the Scope implementation for the given scope name, if any.

      This will only return explicitly registered scopes. Built-in scopes such as "singleton" and "prototype" won't be exposed.

      指定者:
        `getRegisteredScope` 在接口中 `ConfigurableBeanFactory`
      参数:
        `scopeName` - the name of the scope
      返回:
        the registered Scope implementation, or `null` if none
      另请参阅:
        `ConfigurableBeanFactory.registerScope(java.lang.String, org.springframework.beans.factory.config.Scope)`

    - #### setSecurityContextProvider

          public void setSecurityContextProvider(SecurityContextProvider securityProvider)

      Set the security context provider for this bean factory. If a security manager is set, interaction with the user code will be executed using the privileged of the provided security context.

    - #### getAccessControlContext

          public AccessControlContext getAccessControlContext()

      Delegate the creation of the access control context to the `SecurityContextProvider`.
      指定者:
        `getAccessControlContext` 在接口中 `ConfigurableBeanFactory`
      覆盖:
        `getAccessControlContext` 在类中 `FactoryBeanRegistrySupport`
      返回:
        the applicable AccessControlContext (never `null`)
      另请参阅:
        `AccessController.getContext()`

    - #### copyConfigurationFrom

          public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)

      从接口复制的说明: `ConfigurableBeanFactory`
      Copy all relevant configuration from the given other factory.

      Should include all standard configuration settings as well as BeanPostProcessors, Scopes, and factory-specific internal settings. Should not include any metadata of actual bean definitions, such as BeanDefinition objects and bean name aliases.

      指定者:
        `copyConfigurationFrom` 在接口中 `ConfigurableBeanFactory`
      参数:
        `otherFactory` - the other BeanFactory to copy from

    - #### getMergedBeanDefinition

          public BeanDefinition getMergedBeanDefinition(String name)
                                                 throws BeansException

      Return a 'merged' BeanDefinition for the given bean name, merging a child bean definition with its parent if necessary.

      This `getMergedBeanDefinition` considers bean definition in ancestors as well.

      指定者:
        `getMergedBeanDefinition` 在接口中 `ConfigurableBeanFactory`
      参数:
        `name` - the name of the bean to retrieve the merged definition for (may be an alias)
      返回:
        a (potentially merged) RootBeanDefinition for the given bean
      抛出:
        `NoSuchBeanDefinitionException` - if there is no bean with the given name
        `BeanDefinitionStoreException` - in case of an invalid bean definition
        `BeansException`

    - #### isFactoryBean

          public boolean isFactoryBean(String name)
                                throws NoSuchBeanDefinitionException

      从接口复制的说明: `ConfigurableBeanFactory`
      Determine whether the bean with the given name is a FactoryBean.
      指定者:
        `isFactoryBean` 在接口中 `ConfigurableBeanFactory`
      参数:
        `name` - the name of the bean to check
      返回:
        whether the bean is a FactoryBean (`false` means the bean exists but is not a FactoryBean)
      抛出:
        `NoSuchBeanDefinitionException` - if there is no bean with the given name

    - #### isActuallyInCreation

          public boolean isActuallyInCreation(String beanName)

      覆盖:
        `isActuallyInCreation` 在类中 `DefaultSingletonBeanRegistry`

    - #### isPrototypeCurrentlyInCreation

          protected boolean isPrototypeCurrentlyInCreation(String beanName)

      Return whether the specified prototype bean is currently in creation (within the current thread).
      参数:
        `beanName` - the name of the bean

    - #### beforePrototypeCreation

          protected void beforePrototypeCreation(String beanName)

      Callback before prototype creation.

      The default implementation register the prototype as currently in creation.

      参数:
        `beanName` - the name of the prototype about to be created
      另请参阅:
        `isPrototypeCurrentlyInCreation(java.lang.String)`

    - #### afterPrototypeCreation

          protected void afterPrototypeCreation(String beanName)

      Callback after prototype creation.

      The default implementation marks the prototype as not in creation anymore.

      参数:
        `beanName` - the name of the prototype that has been created
      另请参阅:
        `isPrototypeCurrentlyInCreation(java.lang.String)`

    - #### destroyBean

          public void destroyBean(String beanName,
                                  Object beanInstance)

      从接口复制的说明: `ConfigurableBeanFactory`
      Destroy the given bean instance (usually a prototype instance obtained from this factory) according to its bean definition.

      Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.

      指定者:
        `destroyBean` 在接口中 `ConfigurableBeanFactory`
      参数:
        `beanName` - the name of the bean definition
        `beanInstance` - the bean instance to destroy

    - #### destroyBean

          protected void destroyBean(String beanName,
                                     Object bean,
                                     RootBeanDefinition mbd)

      Destroy the given bean instance (usually a prototype instance obtained from this factory) according to the given bean definition.
      参数:
        `beanName` - the name of the bean definition
        `bean` - the bean instance to destroy
        `mbd` - the merged bean definition

    - #### destroyScopedBean

          public void destroyScopedBean(String beanName)

      从接口复制的说明: `ConfigurableBeanFactory`
      Destroy the specified scoped bean in the current target scope, if any.

      Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.

      指定者:
        `destroyScopedBean` 在接口中 `ConfigurableBeanFactory`
      参数:
        `beanName` - the name of the scoped bean

    - #### transformedBeanName

          protected String transformedBeanName(String name)

      解析别名
      参数:
        `name` - bean的名称(可能包含工厂Bean的&,或者是别名)
      返回:
        真正bean的名称

    - #### originalBeanName

          protected String originalBeanName(String name)

      获取原始bean的name
      参数:
        `name` - the user-specified name
      返回:
        the original bean name

    - #### initBeanWrapper

          protected void initBeanWrapper(BeanWrapper bw)

      Initialize the given BeanWrapper with the custom editors registered with this factory. To be called for BeanWrappers that will create and populate bean instances.

      The default implementation delegates to `registerCustomEditors(org.springframework.beans.PropertyEditorRegistry)`. Can be overridden in subclasses.

      参数:
        `bw` - the BeanWrapper to initialize

    - #### registerCustomEditors

          protected void registerCustomEditors(PropertyEditorRegistry registry)

      Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory.

      To be called for BeanWrappers that will create and populate bean instances, and for SimpleTypeConverter used for constructor argument and factory method type conversion.

      参数:
        `registry` - the PropertyEditorRegistry to initialize

    - #### getMergedLocalBeanDefinition

          protected RootBeanDefinition getMergedLocalBeanDefinition(String beanName)
                                                             throws BeansException

      Return a merged RootBeanDefinition, traversing the parent bean definition if the specified bean corresponds to a child bean definition.
      参数:
        `beanName` - the name of the bean to retrieve the merged definition for
      返回:
        a (potentially merged) RootBeanDefinition for the given bean
      抛出:
        `NoSuchBeanDefinitionException` - if there is no bean with the given name
        `BeanDefinitionStoreException` - in case of an invalid bean definition
        `BeansException`

    - #### getMergedBeanDefinition

          protected RootBeanDefinition getMergedBeanDefinition(String beanName,
                                                               BeanDefinition bd)
                                                        throws BeanDefinitionStoreException

      Return a RootBeanDefinition for the given top-level bean, by merging with the parent if the given bean's definition is a child bean definition.
      参数:
        `beanName` - the name of the bean definition
        `bd` - the original bean definition (Root/ChildBeanDefinition)
      返回:
        a (potentially merged) RootBeanDefinition for the given bean
      抛出:
        `BeanDefinitionStoreException` - in case of an invalid bean definition

    - #### getMergedBeanDefinition

          protected RootBeanDefinition getMergedBeanDefinition(String beanName,
                                                               BeanDefinition bd,
                                                               @Nullable
                                                               BeanDefinition containingBd)
                                                        throws BeanDefinitionStoreException

      Return a RootBeanDefinition for the given bean, by merging with the parent if the given bean's definition is a child bean definition.
      参数:
        `beanName` - the name of the bean definition
        `bd` - the original bean definition (Root/ChildBeanDefinition)
        `containingBd` - the containing bean definition in case of inner bean, or `null` in case of a top-level bean
      返回:
        a (potentially merged) RootBeanDefinition for the given bean
      抛出:
        `BeanDefinitionStoreException` - in case of an invalid bean definition

    - #### checkMergedBeanDefinition

          protected void checkMergedBeanDefinition(RootBeanDefinition mbd,
                                                   String beanName,
                                                   @Nullable
                                                   Object[] args)
                                            throws BeanDefinitionStoreException

      Check the given merged bean definition, potentially throwing validation exceptions.
      参数:
        `mbd` - the merged bean definition to check
        `beanName` - the name of the bean
        `args` - the arguments for bean creation, if any
      抛出:
        `BeanDefinitionStoreException` - in case of validation failure

    - #### clearMergedBeanDefinition

          protected void clearMergedBeanDefinition(String beanName)

      Remove the merged bean definition for the specified bean, recreating it on next access.
      参数:
        `beanName` - the bean name to clear the merged definition for

    - #### clearMetadataCache

          public void clearMetadataCache()

      Clear the merged bean definition cache, removing entries for beans which are not considered eligible for full metadata caching yet.

      Typically triggered after changes to the original bean definitions, e.g. after applying a `BeanFactoryPostProcessor`. Note that metadata for beans which have already been created at this point will be kept around.

      从以下版本开始:
        4.2

    - #### resolveBeanClass

          @Nullable
          protected Class<?> resolveBeanClass(RootBeanDefinition mbd,
                                                         String beanName,
                                                         Class<?>... typesToMatch)
                                                  throws CannotLoadBeanClassException

      Resolve the bean class for the specified bean definition, resolving a bean class name into a Class reference (if necessary) and storing the resolved Class in the bean definition for further use.
      参数:
        `mbd` - the merged bean definition to determine the class for
        `beanName` - the name of the bean (for error handling purposes)
        `typesToMatch` - the types to match in case of internal type matching purposes (also signals that the returned `Class` will never be exposed to application code)
      返回:
        the resolved bean class (or `null` if none)
      抛出:
        `CannotLoadBeanClassException` - if we failed to load the class

    - #### evaluateBeanDefinitionString

          @Nullable
          protected Object evaluateBeanDefinitionString(@Nullable
                                                                   String value,
                                                                   @Nullable
                                                                   BeanDefinition beanDefinition)

      Evaluate the given String as contained in a bean definition, potentially resolving it as an expression.
      参数:
        `value` - the value to check
        `beanDefinition` - the bean definition that the value comes from
      返回:
        the resolved value
      另请参阅:
        `setBeanExpressionResolver(org.springframework.beans.factory.config.BeanExpressionResolver)`

    - #### predictBeanType

          @Nullable
          protected Class<?> predictBeanType(String beanName,
                                                        RootBeanDefinition mbd,
                                                        Class<?>... typesToMatch)

      Predict the eventual bean type (of the processed bean instance) for the specified bean. Called by `getType(java.lang.String)` and `isTypeMatch(java.lang.String, org.springframework.core.ResolvableType)`. Does not need to handle FactoryBeans specifically, since it is only supposed to operate on the raw bean type.

      This implementation is simplistic in that it is not able to handle factory methods and InstantiationAwareBeanPostProcessors. It only predicts the bean type correctly for a standard bean. To be overridden in subclasses, applying more sophisticated type detection.

      参数:
        `beanName` - the name of the bean
        `mbd` - the merged bean definition to determine the type for
        `typesToMatch` - the types to match in case of internal type matching purposes (also signals that the returned `Class` will never be exposed to application code)
      返回:
        the type of the bean, or `null` if not predictable

    - #### isFactoryBean

          protected boolean isFactoryBean(String beanName,
                                          RootBeanDefinition mbd)

      Check whether the given bean is defined as a `FactoryBean`.
      参数:
        `beanName` - the name of the bean
        `mbd` - the corresponding bean definition

    - #### getTypeForFactoryBean

          @Nullable
          protected Class<?> getTypeForFactoryBean(String beanName,
                                                              RootBeanDefinition mbd)

      Determine the bean type for the given FactoryBean definition, as far as possible. Only called if there is no singleton instance registered for the target bean already.

      The default implementation creates the FactoryBean via `getBean` to call its `getObjectType` method. Subclasses are encouraged to optimize this, typically by just instantiating the FactoryBean but not populating it yet, trying whether its `getObjectType` method already returns a type. If no type found, a full FactoryBean creation as performed by this implementation should be used as fallback.

      参数:
        `beanName` - the name of the bean
        `mbd` - the merged bean definition for the bean
      返回:
        the type for the bean if determinable, or `null` otherwise
      另请参阅:
        `FactoryBean.getObjectType()`, `getBean(String)`

    - #### markBeanAsCreated

          protected void markBeanAsCreated(String beanName)

      Mark the specified bean as already created (or about to be created).

      This allows the bean factory to optimize its caching for repeated creation of the specified bean.

      参数:
        `beanName` - the name of the bean

    - #### cleanupAfterBeanCreationFailure

          protected void cleanupAfterBeanCreationFailure(String beanName)

      Perform appropriate cleanup of cached metadata after bean creation failed.
      参数:
        `beanName` - the name of the bean

    - #### isBeanEligibleForMetadataCaching

          protected boolean isBeanEligibleForMetadataCaching(String beanName)

      Determine whether the specified bean is eligible for having its bean definition metadata cached.
      参数:
        `beanName` - the name of the bean
      返回:
        `true` if the bean's metadata may be cached at this point already

    - #### removeSingletonIfCreatedForTypeCheckOnly

          protected boolean removeSingletonIfCreatedForTypeCheckOnly(String beanName)

      Remove the singleton instance (if any) for the given bean name, but only if it hasn't been used for other purposes than type checking.
      参数:
        `beanName` - the name of the bean
      返回:
        `true` if actually removed, `false` otherwise

    - #### hasBeanCreationStarted

          protected boolean hasBeanCreationStarted()

      Check whether this factory's bean creation phase already started, i.e. whether any bean has been marked as created in the meantime.
      从以下版本开始:
        4.2.2
      另请参阅:
        `markBeanAsCreated(java.lang.String)`

    - #### getObjectForBeanInstance

          protected Object getObjectForBeanInstance(Object beanInstance,
                                                    String name,
                                                    String beanName,
                                                    @Nullable
                                                    RootBeanDefinition mbd)

      Get the object for the given bean instance, either the bean instance itself or its created object in case of a FactoryBean.
      参数:
        `beanInstance` - the shared bean instance
        `name` - name that may include factory dereference prefix
        `beanName` - the canonical bean name
        `mbd` - the merged bean definition
      返回:
        the object to expose for the bean

    - #### isBeanNameInUse

          public boolean isBeanNameInUse(String beanName)

      Determine whether the given bean name is already in use within this factory, i.e. whether there is a local bean or alias registered under this name or an inner bean created with this name.
      参数:
        `beanName` - the name to check

    - #### requiresDestruction

          protected boolean requiresDestruction(Object bean,
                                                RootBeanDefinition mbd)

      Determine whether the given bean requires destruction on shutdown.

      The default implementation checks the DisposableBean interface as well as a specified destroy method and registered DestructionAwareBeanPostProcessors.

      参数:
        `bean` - the bean instance to check
        `mbd` - the corresponding bean definition
      另请参阅:
        `DisposableBean`, `AbstractBeanDefinition.getDestroyMethodName()`, `DestructionAwareBeanPostProcessor`

    - #### registerDisposableBeanIfNecessary

          protected void registerDisposableBeanIfNecessary(String beanName,
                                                           Object bean,
                                                           RootBeanDefinition mbd)

      Add the given bean to the list of disposable beans in this factory, registering its DisposableBean interface and/or the given destroy method to be called on factory shutdown (if applicable). Only applies to singletons.
      参数:
        `beanName` - the name of the bean
        `bean` - the bean instance
        `mbd` - the bean definition for the bean
      另请参阅:
        `AbstractBeanDefinition.isSingleton()`, `AbstractBeanDefinition.getDependsOn()`, `DefaultSingletonBeanRegistry.registerDisposableBean(java.lang.String, org.springframework.beans.factory.DisposableBean)`, `DefaultSingletonBeanRegistry.registerDependentBean(java.lang.String, java.lang.String)`

    - #### containsBeanDefinition

          protected abstract boolean containsBeanDefinition(String beanName)

      Check if this bean factory contains a bean definition with the given name. Does not consider any hierarchy this factory may participate in. Invoked by `containsBean` when no cached singleton instance is found.

      Depending on the nature of the concrete bean factory implementation, this operation might be expensive (for example, because of directory lookups in external registries). However, for listable bean factories, this usually just amounts to a local hash lookup: The operation is therefore part of the public interface there. The same implementation can serve for both this template method and the public interface method in that case.

      参数:
        `beanName` - the name of the bean to look for
      返回:
        if this bean factory contains a bean definition with the given name
      另请参阅:
        `containsBean(java.lang.String)`, `ListableBeanFactory.containsBeanDefinition(java.lang.String)`

    - #### getBeanDefinition

          protected abstract BeanDefinition getBeanDefinition(String beanName)
                                                       throws BeansException

      Return the bean definition for the given bean name. Subclasses should normally implement caching, as this method is invoked by this class every time bean definition metadata is needed.

      Depending on the nature of the concrete bean factory implementation, this operation might be expensive (for example, because of directory lookups in external registries). However, for listable bean factories, this usually just amounts to a local hash lookup: The operation is therefore part of the public interface there. The same implementation can serve for both this template method and the public interface method in that case.

      参数:
        `beanName` - the name of the bean to find a definition for
      返回:
        the BeanDefinition for this prototype name (never `null`)
      抛出:
        `NoSuchBeanDefinitionException` - if the bean definition cannot be resolved
        `BeansException` - in case of errors
      另请参阅:
        `RootBeanDefinition`, `ChildBeanDefinition`, `ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String)`

    - #### createBean

          protected abstract Object createBean(String beanName,
                                               RootBeanDefinition mbd,
                                               @Nullable
                                               Object[] args)
                                        throws BeanCreationException

      该方法定义在 AbstractBeanFactory 中，其含义是根据给定的 BeanDefinition 和 args 实例化一个 Bean 对象。 如果该 BeanDefinition 存在父类，则该 BeanDefinition 已经合并了父类的属性。 所有 Bean 实例的创建，都会委托给该方法实现。

      All bean retrieval methods delegate to this method for actual bean creation.

      参数:
        `beanName` - bean的名称
        `mbd` - 已经合并了父类属性的（如果有的话）BeanDefinition 对象。
        `args` - 用于构造函数或者工厂方法创建 Bean 实例对象的参数。
      返回:
        返回一个单实例bean
      抛出:
        `BeanCreationException`