org.springframework.beans.factory.support

## 类 DefaultListableBeanFactory

- 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
        - - org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
          - - org.springframework.beans.factory.support.DefaultListableBeanFactory

- 所有已实现的接口:
    Serializable, BeanFactory, AutowireCapableBeanFactory, ConfigurableBeanFactory, ConfigurableListableBeanFactory, SingletonBeanRegistry, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, org.springframework.core.AliasRegistry
  直接已知子类:
    XmlBeanFactory

      public class DefaultListableBeanFactory
      extends AbstractAutowireCapableBeanFactory
      implements ConfigurableListableBeanFactory, BeanDefinitionRegistry, Serializable

  Spring's default implementation of the `ConfigurableListableBeanFactory` and `BeanDefinitionRegistry` interfaces: a full-fledged bean factory based on bean definition metadata, extensible through post-processors.

  Typical usage is registering all bean definitions first (possibly read from a bean definition file), before accessing beans. Bean lookup by name is therefore an inexpensive operation in a local bean definition table, operating on pre-resolved bean definition metadata objects.

  Note that readers for specific bean definition formats are typically implemented separately rather than as bean factory subclasses: see for example `PropertiesBeanDefinitionReader` and `XmlBeanDefinitionReader`.

  For an alternative implementation of the `ListableBeanFactory` interface, have a look at `StaticListableBeanFactory`, which manages existing bean instances rather than creating new ones based on bean definitions.

  从以下版本开始:
    16 April 2001
  作者:
    Rod Johnson, Juergen Hoeller, Sam Brannen, Costin Leau, Chris Beams, Phillip Webb, Stephane Nicoll
  另请参阅:
    `registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)`, `AbstractBeanFactory.addBeanPostProcessor(org.springframework.beans.factory.config.BeanPostProcessor)`, `getBean(java.lang.Class<T>)`, `resolveDependency(org.springframework.beans.factory.config.DependencyDescriptor, java.lang.String, java.util.Set<java.lang.String>, org.springframework.beans.TypeConverter)`, 序列化表格

- - ### 字段概要

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

      `logger`

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

      `AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO`

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

      `SCOPE_PROTOTYPE, SCOPE_SINGLETON`

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

      `FACTORY_BEAN_PREFIX`

  - ### 构造器概要

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

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected boolean` | `allowAliasOverriding()` Only allows alias overriding if bean definition overriding is allowed.
    `void` | `clearMetadataCache()` Clear the merged bean definition cache, removing entries for beans which are not considered eligible for full metadata caching yet.
    `boolean` | `containsBeanDefinition(String beanName)` Check if this bean factory contains a bean definition with the given name.
    `void` | `copyConfigurationFrom(ConfigurableBeanFactory otherFactory)` Copy all relevant configuration from the given other factory.
    `void` | `destroySingleton(String beanName)` 发生移除，销毁当前bean的所有信息
    `void` | `destroySingletons()` Destroy all singleton beans in this factory, including inner beans that have been registered as disposable.
    `protected String` | `determineAutowireCandidate(Map<String,Object> candidates, DependencyDescriptor descriptor)` Determine the autowire candidate in the given set of beans.
    `protected String` | `determineHighestPriorityCandidate(Map<String,Object> candidates, Class<?> requiredType)` Determine the candidate with the highest priority in the given set of beans.
    `protected String` | `determinePrimaryCandidate(Map<String,Object> candidates, Class<?> requiredType)` Determine the primary candidate in the given set of beans.
    `Object` | `doResolveDependency(DependencyDescriptor descriptor, String beanName, Set<String> autowiredBeanNames, TypeConverter typeConverter)`
    `<A extends Annotation> A` | `findAnnotationOnBean(String beanName, Class<A> annotationType)` 在指定name对应的Bean上找指定的注解，如果没有找到的话，去指定Bean的父类或者父接口上查找
    `protected Map<String,Object>` | `findAutowireCandidates(String beanName, Class<?> requiredType, DependencyDescriptor descriptor)` Find bean instances that match the required type.
    `void` | `freezeConfiguration()` Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.
    `AutowireCandidateResolver` | `getAutowireCandidateResolver()` Return the autowire candidate resolver for this BeanFactory (never `null`).
    `<T> T` | `getBean(Class<T> requiredType)` 通过指定的bean的类型去容器中获取对象 若容器中有多个想同类型的bean 我们通过ctx.getBean(beanType.class) 就会抛出异常
    `<T> T` | `getBean(Class<T> requiredType, Object... args)` 获取bean实例
    `BeanDefinition` | `getBeanDefinition(String beanName)` 从原始的bean定义map中获取
    `int` | `getBeanDefinitionCount()` 获取容器中的所有bean定义
    `String[]` | `getBeanDefinitionNames()` 查看此BeanFactory中包含的Bean数量 不支持向上或向下查找 不支持查找非配置文件定义的单例Bean
    `String[]` | `getBeanNamesForAnnotation(Class<? extends Annotation> annotationType)` 找到所有带有指定注解类型的Bean
    `String[]` | `getBeanNamesForType(Class<?> type)` 返回此BeanFactory中所有指定类型的Bean的名字。
    `String[]` | `getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit)` 返回此BeanFactory中所有指定类型（或指定类型的子类型）的Bean的名字。
    `String[]` | `getBeanNamesForType(org.springframework.core.ResolvableType type)` 返回此BeanFactory中所包含的所有Bean定义的名称 不支持向上或向下查找 不支持查找非配置文件定义的单例Bean
    `Iterator<String>` | `getBeanNamesIterator()` Return a unified view over all bean names managed by this factory.
    `<T> Map<String,T>` | `getBeansOfType(Class<T> type)` 返回此BeanFactory中所有指定类型（或指定类型的子类型）的Bean的名字。
    `<T> Map<String,T>` | `getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)` 返回此BeanFactory中所有指定类型（或指定类型的子类型）的Bean的名字。
    `Map<String,Object>` | `getBeansWithAnnotation(Class<? extends Annotation> annotationType)` 找到所有带有指定注解的Bean，返回一个以Bean的name为键，其对应的Bean实例为值的Map
    `Comparator<Object>` | `getDependencyComparator()` Return the dependency comparator for this BeanFactory (may be `null`.
    `protected Integer` | `getPriority(Object beanInstance)` Return the priority assigned for the given bean instance by the `javax.annotation.Priority` annotation.
    `String` | `getSerializationId()` Return an id for serialization purposes, if specified, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.
    `boolean` | `isAllowBeanDefinitionOverriding()` Return whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
    `boolean` | `isAllowEagerClassLoading()` Return whether the factory is allowed to eagerly load bean classes even for bean definitions that are marked as "lazy-init".
    `boolean` | `isAutowireCandidate(String beanName, DependencyDescriptor descriptor)` Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
    `protected boolean` | `isAutowireCandidate(String beanName, DependencyDescriptor descriptor, AutowireCandidateResolver resolver)` Determine whether the specified bean definition qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
    `protected boolean` | `isAutowireCandidate(String beanName, RootBeanDefinition mbd, DependencyDescriptor descriptor, AutowireCandidateResolver resolver)` Determine whether the specified bean definition qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
    `protected boolean` | `isBeanEligibleForMetadataCaching(String beanName)` Considers all beans as eligible for metadata caching if the factory's configuration has been marked as frozen.
    `boolean` | `isConfigurationFrozen()` Return whether this factory's bean definitions are frozen, i.e. are not supposed to be modified or post-processed any further.
    `protected boolean` | `isPrimary(String beanName, Object beanInstance)` Return whether the bean definition for the given bean name has been marked as a primary bean.
    `protected boolean` | `matchesBeanName(String beanName, String candidateName)` Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.
    `void` | `preInstantiateSingletons()` Ensure that all non-lazy-init singletons are instantiated, also considering `FactoryBeans`.
    `void` | `registerBeanDefinition(String beanName, BeanDefinition beanDefinition)` Register a new bean definition with this registry.
    `void` | `registerResolvableDependency(Class<?> dependencyType, Object autowiredValue)` Register a special dependency type with corresponding autowired value.
    `void` | `registerSingleton(String beanName, Object singletonObject)` Register the given existing object as singleton in the bean registry, under the given bean name.
    `void` | `removeBeanDefinition(String beanName)` Remove the BeanDefinition for the given name.
    `protected void` | `resetBeanDefinition(String beanName)` Reset all bean definition caches for the given bean, including the caches of beans that are derived from it.
    `Object` | `resolveDependency(DependencyDescriptor descriptor, String requestingBeanName, Set<String> autowiredBeanNames, TypeConverter typeConverter)` Resolve the specified dependency against the beans defined in this factory.
    `<T> NamedBeanHolder<T>` | `resolveNamedBean(Class<T> requiredType)` Resolve the bean instance that uniquely matches the given object type, if any, including its bean name.
    `void` | `setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding)` Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
    `void` | `setAllowEagerClassLoading(boolean allowEagerClassLoading)` Set whether the factory is allowed to eagerly load bean classes even for bean definitions that are marked as "lazy-init".
    `void` | `setAutowireCandidateResolver(AutowireCandidateResolver autowireCandidateResolver)` Set a custom autowire candidate resolver for this BeanFactory to use when deciding whether a bean definition should be considered as a candidate for autowiring.
    `void` | `setDependencyComparator(Comparator<Object> dependencyComparator)` Set a `Comparator` for dependency Lists and arrays.
    `void` | `setSerializationId(String serializationId)` Specify an id for serialization purposes, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.
    `String` | `toString()`
    `protected Object` | `writeReplace()`

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

      `applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPostProcessorsBeforeInstantiation, applyBeanPropertyValues, applyMergedBeanDefinitionPostProcessors, applyPropertyValues, autowire, autowireBean, autowireBeanProperties, autowireByName, autowireByType, autowireConstructor, checkDependencies, clearSingletonCache, configureBean, createBean, createBean, createBean, createBeanInstance, destroyBean, determineConstructorsFromBeanPostProcessors, determineTargetType, doCreateBean, filterPropertyDescriptorsForDependencyCheck, filterPropertyDescriptorsForDependencyCheck, getEarlyBeanReference, getInstantiationStrategy, getObjectForBeanInstance, getParameterNameDiscoverer, getTypeForFactoryBean, getTypeForFactoryMethod, ignoreDependencyInterface, ignoreDependencyType, initializeBean, initializeBean, instantiateBean, instantiateUsingFactoryMethod, invokeCustomInitMethod, invokeInitMethods, isExcludedFromDependencyCheck, obtainFromSupplier, populateBean, postProcessObjectFromFactoryBean, predictBeanType, removeSingleton, resolveBeforeInstantiation, resolveDependency, setAllowCircularReferences, setAllowRawInjectionDespiteWrapping, setInstantiationStrategy, setParameterNameDiscoverer, unsatisfiedNonSimpleProperties`

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

      `addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, afterPrototypeCreation, beforePrototypeCreation, checkMergedBeanDefinition, cleanupAfterBeanCreationFailure, clearMergedBeanDefinition, containsBean, containsLocalBean, copyRegisteredEditorsTo, destroyBean, destroyBean, destroyScopedBean, doGetBean, evaluateBeanDefinitionString, getAccessControlContext, getAliases, getBean, getBean, getBean, getBean, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getBeanPostProcessors, getConversionService, getCustomEditors, getCustomTypeConverter, getMergedBeanDefinition, getMergedBeanDefinition, getMergedBeanDefinition, getMergedLocalBeanDefinition, getParentBeanFactory, getPropertyEditorRegistrars, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getType, getTypeConverter, hasBeanCreationStarted, hasDestructionAwareBeanPostProcessors, hasEmbeddedValueResolver, hasInstantiationAwareBeanPostProcessors, initBeanWrapper, isActuallyInCreation, isBeanNameInUse, isCacheBeanMetadata, isFactoryBean, isFactoryBean, isPrototype, isPrototypeCurrentlyInCreation, isSingleton, isTypeMatch, isTypeMatch, markBeanAsCreated, originalBeanName, registerCustomEditor, registerCustomEditors, registerDisposableBeanIfNecessary, registerScope, removeSingletonIfCreatedForTypeCheckOnly, requiresDestruction, resolveBeanClass, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setSecurityContextProvider, setTempClassLoader, setTypeConverter, transformedBeanName`

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

      `getCachedObjectForFactoryBean, getFactoryBean, getObjectFromFactoryBean, getTypeForFactoryBean`

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

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

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

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

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

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

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

      `ignoreDependencyInterface, ignoreDependencyType`

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

      `applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBean, autowireBeanProperties, configureBean, createBean, createBean, destroyBean, initializeBean, resolveDependency`

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

      `addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, copyRegisteredEditorsTo, destroyBean, destroyScopedBean, getAccessControlContext, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getConversionService, getDependenciesForBean, getDependentBeans, getMergedBeanDefinition, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getTypeConverter, hasEmbeddedValueResolver, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, registerAlias, registerCustomEditor, registerDependentBean, registerScope, resolveAliases, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setCurrentlyInCreation, setParentBeanFactory, setTempClassLoader, setTypeConverter`

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

      `containsLocalBean, getParentBeanFactory`

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

      `containsBean, getAliases, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch`

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

      `containsSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames`

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

      `isBeanNameInUse`

    - ### 从接口继承的方法 org.springframework.core.AliasRegistry

      `getAliases, isAlias, registerAlias, removeAlias`

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

    - #### DefaultListableBeanFactory

          public DefaultListableBeanFactory()

      Create a new DefaultListableBeanFactory.

    - #### DefaultListableBeanFactory

          public DefaultListableBeanFactory(@Nullable
                                            BeanFactory parentBeanFactory)

      Create a new DefaultListableBeanFactory with the given parent.
      参数:
        `parentBeanFactory` - the parent BeanFactory

  - ### 方法详细资料

    - #### setSerializationId

          public void setSerializationId(@Nullable
                                         String serializationId)

      Specify an id for serialization purposes, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.

    - #### getSerializationId

          @Nullable
          public String getSerializationId()

      Return an id for serialization purposes, if specified, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.
      从以下版本开始:
        4.1.2

    - #### setAllowBeanDefinitionOverriding

          public void setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding)

      Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former. If not, an exception will be thrown. This also applies to overriding aliases.

      Default is "true".

      另请参阅:
        `registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)`

    - #### isAllowBeanDefinitionOverriding

          public boolean isAllowBeanDefinitionOverriding()

      Return whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
      从以下版本开始:
        4.1.2

    - #### setAllowEagerClassLoading

          public void setAllowEagerClassLoading(boolean allowEagerClassLoading)

      Set whether the factory is allowed to eagerly load bean classes even for bean definitions that are marked as "lazy-init".

      Default is "true". Turn this flag off to suppress class loading for lazy-init beans unless such a bean is explicitly requested. In particular, by-type lookups will then simply ignore bean definitions without resolved class name, instead of loading the bean classes on demand just to perform a type check.

      另请参阅:
        `AbstractBeanDefinition.setLazyInit(boolean)`

    - #### isAllowEagerClassLoading

          public boolean isAllowEagerClassLoading()

      Return whether the factory is allowed to eagerly load bean classes even for bean definitions that are marked as "lazy-init".
      从以下版本开始:
        4.1.2

    - #### setDependencyComparator

          public void setDependencyComparator(@Nullable
                                              Comparator<Object> dependencyComparator)

      Set a `Comparator` for dependency Lists and arrays.
      从以下版本开始:
        4.0
      另请参阅:
        `OrderComparator`, `AnnotationAwareOrderComparator`

    - #### getDependencyComparator

          @Nullable
          public Comparator<Object> getDependencyComparator()

      Return the dependency comparator for this BeanFactory (may be `null`.
      从以下版本开始:
        4.0

    - #### setAutowireCandidateResolver

          public void setAutowireCandidateResolver(AutowireCandidateResolver autowireCandidateResolver)

      Set a custom autowire candidate resolver for this BeanFactory to use when deciding whether a bean definition should be considered as a candidate for autowiring.

    - #### getAutowireCandidateResolver

          public AutowireCandidateResolver getAutowireCandidateResolver()

      Return the autowire candidate resolver for this BeanFactory (never `null`).

    - #### 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`
      覆盖:
        `copyConfigurationFrom` 在类中 `AbstractAutowireCapableBeanFactory`
      参数:
        `otherFactory` - the other BeanFactory to copy from

    - #### getBean

          public <T> T getBean(Class<T> requiredType)
                        throws BeansException

      从接口复制的说明: `BeanFactory`
      通过指定的bean的类型去容器中获取对象 若容器中有多个想同类型的bean 我们通过ctx.getBean(beanType.class) 就会抛出异常
      指定者:
        `getBean` 在接口中 `BeanFactory`
      参数:
        `requiredType` - class对象需要的类型
      返回:
        返回的bean对象
      抛出:
        `NoSuchBeanDefinitionException` - 没有对应class的bean定义
        `NoUniqueBeanDefinitionException` - 找到多个匹配的
        `BeansException` - 创建bean的实例
      另请参阅:
        `ListableBeanFactory`

    - #### getBean

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

      从接口复制的说明: `BeanFactory`
      获取bean实例
      指定者:
        `getBean` 在接口中 `BeanFactory`
      参数:
        `requiredType` - bean的类型
        `args` - 构造函数的参数的类型，在实例化的过程中不需要去推断构造函数了
      返回:
        bean实例
      抛出:
        `NoSuchBeanDefinitionException` - if there is no such bean definition
        `BeanDefinitionStoreException` - if arguments have been given but the affected bean isn't a prototype
        `BeansException` - if the bean could not be created

    - #### containsBeanDefinition

          public boolean containsBeanDefinition(String beanName)

      从类复制的说明: `AbstractBeanFactory`
      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.

      指定者:
        `containsBeanDefinition` 在接口中 `ListableBeanFactory`
      指定者:
        `containsBeanDefinition` 在接口中 `BeanDefinitionRegistry`
      指定者:
        `containsBeanDefinition` 在类中 `AbstractBeanFactory`
      参数:
        `beanName` - the name of the bean to look for
      返回:
        if this bean factory contains a bean definition with the given name
      另请参阅:
        `AbstractBeanFactory.containsBean(java.lang.String)`, `ListableBeanFactory.containsBeanDefinition(java.lang.String)`

    - #### getBeanDefinitionCount

          public int getBeanDefinitionCount()

      从接口复制的说明: `ListableBeanFactory`
      获取容器中的所有bean定义
      指定者:
        `getBeanDefinitionCount` 在接口中 `ListableBeanFactory`
      指定者:
        `getBeanDefinitionCount` 在接口中 `BeanDefinitionRegistry`
      返回:
        the number of beans defined in the factory

    - #### getBeanDefinitionNames

          public String[] getBeanDefinitionNames()

      从接口复制的说明: `ListableBeanFactory`
      查看此BeanFactory中包含的Bean数量 不支持向上或向下查找 不支持查找非配置文件定义的单例Bean
      指定者:
        `getBeanDefinitionNames` 在接口中 `ListableBeanFactory`
      指定者:
        `getBeanDefinitionNames` 在接口中 `BeanDefinitionRegistry`
      返回:
        the names of all beans defined in this registry, or an empty array if none defined

    - #### getBeanNamesForType

          public String[] getBeanNamesForType(org.springframework.core.ResolvableType type)

      从接口复制的说明: `ListableBeanFactory`
      返回此BeanFactory中所包含的所有Bean定义的名称 不支持向上或向下查找 不支持查找非配置文件定义的单例Bean
      指定者:
        `getBeanNamesForType` 在接口中 `ListableBeanFactory`

    - #### getBeanNamesForType

          public String[] getBeanNamesForType(@Nullable
                                              Class<?> type)

      从接口复制的说明: `ListableBeanFactory`
      返回此BeanFactory中所有指定类型的Bean的名字。判断是否是指定类型的标准有两个：a Bean定义。 b FactoryBean的getObjectType方法。 只考虑最顶层的Bean，对于嵌套的Bean，即使符合类型也不予考虑 会考虑FactoryBean创建出的Bean 不支持向上或向下查找 不支持查找非配置文件定义的单例Bean 此签名的getBeanNamesForType方法会返回所有Scope类型的Bean，在大多数的实现中，其返回结果和 其重载方法getBeanNamesForType(type, true, true)返回结果一致。 返回结果中，Bean名字的顺序应该和其定义时一样
      指定者:
        `getBeanNamesForType` 在接口中 `ListableBeanFactory`

    - #### getBeanNamesForType

          public String[] getBeanNamesForType(@Nullable
                                              Class<?> type,
                                              boolean includeNonSingletons,
                                              boolean allowEagerInit)

      从接口复制的说明: `ListableBeanFactory`
      返回此BeanFactory中所有指定类型（或指定类型的子类型）的Bean的名字。判断是否是指定类型的标准有 两个：a Bean定义，b FactoryBean的getObjectType方法。 只考虑最顶层的Bean，对于嵌套的Bean，即使符合类型也不予考虑 会考虑FactoryBean创建出的Bean 不支持向上或向下查找 不支持查找非配置文件定义的单例Bean 此签名的getBeanNamesForType方法会返回所有Scope类型的Bean，在大多数的实现中，其返回结果和 其重载方法getBeanNamesForType(type, true, true)返回结果一致。 返回结果中，Bean名字的顺序应该和其定义时一样
      指定者:
        `getBeanNamesForType` 在接口中 `ListableBeanFactory`

    - #### getBeansOfType

          public <T> Map<String,T> getBeansOfType(@Nullable
                                                  Class<T> type)
                                           throws BeansException

      从接口复制的说明: `ListableBeanFactory`
      返回此BeanFactory中所有指定类型（或指定类型的子类型）的Bean的名字。判断是否是指定类型的标准有 两个：a Bean定义，b FactoryBean的getObjectType方法。 只考虑最顶层的Bean，对于嵌套的Bean，即使符合类型也不予考虑 会考虑FactoryBean创建出的Bean 不支持向上或向下查找 不支持查找非配置文件定义的单例Bean 此签名的getBeanNamesForType方法会返回所有Scope类型的Bean，在大多数的实现中，其返回结果和 其重载方法getBeanNamesForType(type, true, true)返回结果一致。 返回结果中，Bean名字的顺序应该和其定义时一样 如果Bean是通过FactoryBean创建的，那么只考虑设置了allowEagerInit标志位的Bean。如果 没有设置allowEagerInit标志位，则只考虑FactoryBean的类型
      指定者:
        `getBeansOfType` 在接口中 `ListableBeanFactory`
      抛出:
        `BeansException`

    - #### getBeansOfType

          public <T> Map<String,T> getBeansOfType(@Nullable
                                                  Class<T> type,
                                                  boolean includeNonSingletons,
                                                  boolean allowEagerInit)
                                           throws BeansException

      从接口复制的说明: `ListableBeanFactory`
      返回此BeanFactory中所有指定类型（或指定类型的子类型）的Bean的名字。判断是否是指定类型的标准有 两个：a Bean定义，b FactoryBean的getObjectType方法。 只考虑最顶层的Bean，对于嵌套的Bean，即使符合类型也不予考虑 会考虑FactoryBean创建出的Bean 不支持向上或向下查找 不支持查找非配置文件定义的单例Bean 此签名的getBeanNamesForType方法会返回所有Scope类型的Bean，在大多数的实现中，其返回结果和 其重载方法getBeanNamesForType(type, true, true)返回结果一致。 返回结果中，Bean名字的顺序应该和其定义时一样
      指定者:
        `getBeansOfType` 在接口中 `ListableBeanFactory`
      抛出:
        `BeansException`

    - #### getBeanNamesForAnnotation

          public String[] getBeanNamesForAnnotation(Class<? extends Annotation> annotationType)

      从接口复制的说明: `ListableBeanFactory`
      找到所有带有指定注解类型的Bean
      指定者:
        `getBeanNamesForAnnotation` 在接口中 `ListableBeanFactory`

    - #### getBeansWithAnnotation

          public Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)

      从接口复制的说明: `ListableBeanFactory`
      找到所有带有指定注解的Bean，返回一个以Bean的name为键，其对应的Bean实例为值的Map
      指定者:
        `getBeansWithAnnotation` 在接口中 `ListableBeanFactory`

    - #### findAnnotationOnBean

          @Nullable
          public <A extends Annotation> A findAnnotationOnBean(String beanName,
                                                                          Class<A> annotationType)
                                                                   throws NoSuchBeanDefinitionException

      从接口复制的说明: `ListableBeanFactory`
      在指定name对应的Bean上找指定的注解，如果没有找到的话，去指定Bean的父类或者父接口上查找
      指定者:
        `findAnnotationOnBean` 在接口中 `ListableBeanFactory`
      抛出:
        `NoSuchBeanDefinitionException`

    - #### registerResolvableDependency

          public void registerResolvableDependency(Class<?> dependencyType,
                                                   @Nullable
                                                   Object autowiredValue)

      从接口复制的说明: `ConfigurableListableBeanFactory`
      Register a special dependency type with corresponding autowired value.

      This is intended for factory/context references that are supposed to be autowirable but are not defined as beans in the factory: e.g. a dependency of type ApplicationContext resolved to the ApplicationContext instance that the bean is living in.

      Note: There are no such default types registered in a plain BeanFactory, not even for the BeanFactory interface itself.

      指定者:
        `registerResolvableDependency` 在接口中 `ConfigurableListableBeanFactory`
      参数:
        `dependencyType` - the dependency type to register. This will typically be a base interface such as BeanFactory, with extensions of it resolved as well if declared as an autowiring dependency (e.g. ListableBeanFactory), as long as the given value actually implements the extended interface.
        `autowiredValue` - the corresponding autowired value. This may also be an implementation of the `ObjectFactory` interface, which allows for lazy resolution of the actual target value.

    - #### isAutowireCandidate

          public boolean isAutowireCandidate(String beanName,
                                             DependencyDescriptor descriptor)
                                      throws NoSuchBeanDefinitionException

      从接口复制的说明: `ConfigurableListableBeanFactory`
      Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.

      This method checks ancestor factories as well.

      指定者:
        `isAutowireCandidate` 在接口中 `ConfigurableListableBeanFactory`
      参数:
        `beanName` - the name of the bean to check
        `descriptor` - the descriptor of the dependency to resolve
      返回:
        whether the bean should be considered as autowire candidate
      抛出:
        `NoSuchBeanDefinitionException` - if there is no bean with the given name

    - #### isAutowireCandidate

          protected boolean isAutowireCandidate(String beanName,
                                                DependencyDescriptor descriptor,
                                                AutowireCandidateResolver resolver)
                                         throws NoSuchBeanDefinitionException

      Determine whether the specified bean definition qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
      参数:
        `beanName` - the name of the bean definition to check
        `descriptor` - the descriptor of the dependency to resolve
        `resolver` - the AutowireCandidateResolver to use for the actual resolution algorithm
      返回:
        whether the bean should be considered as autowire candidate
      抛出:
        `NoSuchBeanDefinitionException`

    - #### isAutowireCandidate

          protected boolean isAutowireCandidate(String beanName,
                                                RootBeanDefinition mbd,
                                                DependencyDescriptor descriptor,
                                                AutowireCandidateResolver resolver)

      Determine whether the specified bean definition qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
      参数:
        `beanName` - the name of the bean definition to check
        `mbd` - the merged bean definition to check
        `descriptor` - the descriptor of the dependency to resolve
        `resolver` - the AutowireCandidateResolver to use for the actual resolution algorithm
      返回:
        whether the bean should be considered as autowire candidate

    - #### getBeanDefinition

          public BeanDefinition getBeanDefinition(String beanName)
                                           throws NoSuchBeanDefinitionException

      从原始的bean定义map中获取
      指定者:
        `getBeanDefinition` 在接口中 `ConfigurableListableBeanFactory`
      指定者:
        `getBeanDefinition` 在接口中 `BeanDefinitionRegistry`
      指定者:
        `getBeanDefinition` 在类中 `AbstractBeanFactory`
      参数:
        `beanName` - bean的名称
      返回:
        BeanDefinition 原始的bean定义
      抛出:
        `NoSuchBeanDefinitionException`
      另请参阅:
        `RootBeanDefinition`, `ChildBeanDefinition`, `ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String)`

    - #### getBeanNamesIterator

          public Iterator<String> getBeanNamesIterator()

      从接口复制的说明: `ConfigurableListableBeanFactory`
      Return a unified view over all bean names managed by this factory.

      Includes bean definition names as well as names of manually registered singleton instances, with bean definition names consistently coming first, analogous to how type/annotation specific retrieval of bean names works.

      指定者:
        `getBeanNamesIterator` 在接口中 `ConfigurableListableBeanFactory`
      返回:
        the composite iterator for the bean names view
      另请参阅:
        `ListableBeanFactory.containsBeanDefinition(java.lang.String)`, `SingletonBeanRegistry.registerSingleton(java.lang.String, java.lang.Object)`, `ListableBeanFactory.getBeanNamesForType(org.springframework.core.ResolvableType)`, `ListableBeanFactory.getBeanNamesForAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation>)`

    - #### clearMetadataCache

          public void clearMetadataCache()

      从类复制的说明: `AbstractBeanFactory`
      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.

      指定者:
        `clearMetadataCache` 在接口中 `ConfigurableListableBeanFactory`
      覆盖:
        `clearMetadataCache` 在类中 `AbstractBeanFactory`
      另请参阅:
        `ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String)`, `ConfigurableBeanFactory.getMergedBeanDefinition(java.lang.String)`

    - #### freezeConfiguration

          public void freezeConfiguration()

      从接口复制的说明: `ConfigurableListableBeanFactory`
      Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.

      This allows the factory to aggressively cache bean definition metadata.

      指定者:
        `freezeConfiguration` 在接口中 `ConfigurableListableBeanFactory`

    - #### isConfigurationFrozen

          public boolean isConfigurationFrozen()

      从接口复制的说明: `ConfigurableListableBeanFactory`
      Return whether this factory's bean definitions are frozen, i.e. are not supposed to be modified or post-processed any further.
      指定者:
        `isConfigurationFrozen` 在接口中 `ConfigurableListableBeanFactory`
      返回:
        `true` if the factory's configuration is considered frozen

    - #### isBeanEligibleForMetadataCaching

          protected boolean isBeanEligibleForMetadataCaching(String beanName)

      Considers all beans as eligible for metadata caching if the factory's configuration has been marked as frozen.
      覆盖:
        `isBeanEligibleForMetadataCaching` 在类中 `AbstractBeanFactory`
      参数:
        `beanName` - the name of the bean
      返回:
        `true` if the bean's metadata may be cached at this point already
      另请参阅:
        `freezeConfiguration()`

    - #### preInstantiateSingletons

          public void preInstantiateSingletons()
                                        throws BeansException

      从接口复制的说明: `ConfigurableListableBeanFactory`
      Ensure that all non-lazy-init singletons are instantiated, also considering `FactoryBeans`. Typically invoked at the end of factory setup, if desired.
      指定者:
        `preInstantiateSingletons` 在接口中 `ConfigurableListableBeanFactory`
      抛出:
        `BeansException` - if one of the singleton beans could not be created. Note: This may have left the factory with some beans already initialized! Call `ConfigurableBeanFactory.destroySingletons()` for full cleanup in this case.
      另请参阅:
        `ConfigurableBeanFactory.destroySingletons()`

    - #### registerBeanDefinition

          public void registerBeanDefinition(String beanName,
                                             BeanDefinition beanDefinition)
                                      throws BeanDefinitionStoreException

      从接口复制的说明: `BeanDefinitionRegistry`
      Register a new bean definition with this registry. Must support RootBeanDefinition and ChildBeanDefinition.
      指定者:
        `registerBeanDefinition` 在接口中 `BeanDefinitionRegistry`
      参数:
        `beanName` - the name of the bean instance to register
        `beanDefinition` - definition of the bean instance to register
      抛出:
        `BeanDefinitionStoreException` - if the BeanDefinition is invalid or if there is already a BeanDefinition for the specified bean name (and we are not allowed to override it)
      另请参阅:
        `GenericBeanDefinition`, `RootBeanDefinition`, `ChildBeanDefinition`

    - #### removeBeanDefinition

          public void removeBeanDefinition(String beanName)
                                    throws NoSuchBeanDefinitionException

      从接口复制的说明: `BeanDefinitionRegistry`
      Remove the BeanDefinition for the given name.
      指定者:
        `removeBeanDefinition` 在接口中 `BeanDefinitionRegistry`
      参数:
        `beanName` - the name of the bean instance to register
      抛出:
        `NoSuchBeanDefinitionException` - if there is no such bean definition

    - #### resetBeanDefinition

          protected void resetBeanDefinition(String beanName)

      Reset all bean definition caches for the given bean, including the caches of beans that are derived from it.
      参数:
        `beanName` - the name of the bean to reset

    - #### allowAliasOverriding

          protected boolean allowAliasOverriding()

      Only allows alias overriding if bean definition overriding is allowed.
      覆盖:
        `allowAliasOverriding` 在类中 `org.springframework.core.SimpleAliasRegistry`

    - #### registerSingleton

          public void registerSingleton(String beanName,
                                        Object singletonObject)
                                 throws IllegalStateException

      从接口复制的说明: `SingletonBeanRegistry`
      Register the given existing object as singleton in the bean registry, under the given bean name.

      The given instance is supposed to be fully initialized; the registry will not perform any initialization callbacks (in particular, it won't call InitializingBean's `afterPropertiesSet` method). The given instance will not receive any destruction callbacks (like DisposableBean's `destroy` method) either.

      When running within a full BeanFactory: Register a bean definition instead of an existing instance if your bean is supposed to receive initialization and/or destruction callbacks.

      Typically invoked during registry configuration, but can also be used for runtime registration of singletons. As a consequence, a registry implementation should synchronize singleton access; it will have to do this anyway if it supports a BeanFactory's lazy initialization of singletons.

      指定者:
        `registerSingleton` 在接口中 `SingletonBeanRegistry`
      覆盖:
        `registerSingleton` 在类中 `DefaultSingletonBeanRegistry`
      参数:
        `beanName` - the name of the bean
        `singletonObject` - the existing singleton object
      抛出:
        `IllegalStateException`
      另请参阅:
        `InitializingBean.afterPropertiesSet()`, `DisposableBean.destroy()`, `BeanDefinitionRegistry.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)`

    - #### destroySingleton

          public void destroySingleton(String beanName)

      从类复制的说明: `DefaultSingletonBeanRegistry`
      发生移除，销毁当前bean的所有信息
      覆盖:
        `destroySingleton` 在类中 `DefaultSingletonBeanRegistry`
      参数:
        `beanName` - bean的名称
      另请参阅:
        `DefaultSingletonBeanRegistry.destroyBean(java.lang.String, org.springframework.beans.factory.DisposableBean)`

    - #### destroySingletons

          public void destroySingletons()

      从接口复制的说明: `ConfigurableBeanFactory`
      Destroy all singleton beans in this factory, including inner beans that have been registered as disposable. To be called on shutdown of a factory.

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

      指定者:
        `destroySingletons` 在接口中 `ConfigurableBeanFactory`
      覆盖:
        `destroySingletons` 在类中 `DefaultSingletonBeanRegistry`

    - #### resolveNamedBean

          public <T> NamedBeanHolder<T> resolveNamedBean(Class<T> requiredType)
                                                  throws BeansException

      从接口复制的说明: `AutowireCapableBeanFactory`
      Resolve the bean instance that uniquely matches the given object type, if any, including its bean name.

      This is effectively a variant of `BeanFactory.getBean(Class)` which preserves the bean name of the matching instance.

      指定者:
        `resolveNamedBean` 在接口中 `AutowireCapableBeanFactory`
      参数:
        `requiredType` - type the bean must match; can be an interface or superclass
      返回:
        the bean name plus bean instance
      抛出:
        `NoSuchBeanDefinitionException` - if no matching bean was found
        `NoUniqueBeanDefinitionException` - if more than one matching bean was found
        `BeansException` - if the bean could not be created
      另请参阅:
        `BeanFactory.getBean(Class)`

    - #### resolveDependency

          @Nullable
          public Object resolveDependency(DependencyDescriptor descriptor,
                                                     @Nullable
                                                     String requestingBeanName,
                                                     @Nullable
                                                     Set<String> autowiredBeanNames,
                                                     @Nullable
                                                     TypeConverter typeConverter)
                                              throws BeansException

      从接口复制的说明: `AutowireCapableBeanFactory`
      Resolve the specified dependency against the beans defined in this factory.
      指定者:
        `resolveDependency` 在接口中 `AutowireCapableBeanFactory`
      参数:
        `descriptor` - the descriptor for the dependency (field/method/constructor)
        `requestingBeanName` - the name of the bean which declares the given dependency
        `autowiredBeanNames` - a Set that all names of autowired beans (used for resolving the given dependency) are supposed to be added to
        `typeConverter` - the TypeConverter to use for populating arrays and collections
      返回:
        the resolved object, or `null` if none found
      抛出:
        `NoSuchBeanDefinitionException` - if no matching bean was found
        `NoUniqueBeanDefinitionException` - if more than one matching bean was found
        `BeansException` - if dependency resolution failed for any other reason
      另请参阅:
        `DependencyDescriptor`

    - #### doResolveDependency

          @Nullable
          public Object doResolveDependency(DependencyDescriptor descriptor,
                                                       @Nullable
                                                       String beanName,
                                                       @Nullable
                                                       Set<String> autowiredBeanNames,
                                                       @Nullable
                                                       TypeConverter typeConverter)
                                                throws BeansException

      抛出:
        `BeansException`

    - #### findAutowireCandidates

          protected Map<String,Object> findAutowireCandidates(@Nullable
                                                              String beanName,
                                                              Class<?> requiredType,
                                                              DependencyDescriptor descriptor)

      Find bean instances that match the required type. Called during autowiring for the specified bean.
      参数:
        `beanName` - the name of the bean that is about to be wired
        `requiredType` - the actual type of bean to look for (may be an array component type or collection element type)
        `descriptor` - the descriptor of the dependency to resolve
      返回:
        a Map of candidate names and candidate instances that match the required type (never `null`)
      抛出:
        `BeansException` - in case of errors
      另请参阅:
        `AbstractAutowireCapableBeanFactory.autowireByType(java.lang.String, org.springframework.beans.factory.support.AbstractBeanDefinition, org.springframework.beans.BeanWrapper, org.springframework.beans.MutablePropertyValues)`, `AbstractAutowireCapableBeanFactory.autowireConstructor(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.reflect.Constructor<?>[], java.lang.Object[])`

    - #### determineAutowireCandidate

          @Nullable
          protected String determineAutowireCandidate(Map<String,Object> candidates,
                                                                 DependencyDescriptor descriptor)

      Determine the autowire candidate in the given set of beans.

      Looks for `@Primary` and `@Priority` (in that order).

      参数:
        `candidates` - a Map of candidate names and candidate instances that match the required type, as returned by `findAutowireCandidates(java.lang.String, java.lang.Class<?>, org.springframework.beans.factory.config.DependencyDescriptor)`
        `descriptor` - the target dependency to match against
      返回:
        the name of the autowire candidate, or `null` if none found

    - #### determinePrimaryCandidate

          @Nullable
          protected String determinePrimaryCandidate(Map<String,Object> candidates,
                                                                Class<?> requiredType)

      Determine the primary candidate in the given set of beans.
      参数:
        `candidates` - a Map of candidate names and candidate instances (or candidate classes if not created yet) that match the required type
        `requiredType` - the target dependency type to match against
      返回:
        the name of the primary candidate, or `null` if none found
      另请参阅:
        `isPrimary(String, Object)`

    - #### determineHighestPriorityCandidate

          @Nullable
          protected String determineHighestPriorityCandidate(Map<String,Object> candidates,
                                                                        Class<?> requiredType)

      Determine the candidate with the highest priority in the given set of beans.

      Based on `@javax.annotation.Priority`. As defined by the related `Ordered` interface, the lowest value has the highest priority.

      参数:
        `candidates` - a Map of candidate names and candidate instances (or candidate classes if not created yet) that match the required type
        `requiredType` - the target dependency type to match against
      返回:
        the name of the candidate with the highest priority, or `null` if none found
      另请参阅:
        `getPriority(Object)`

    - #### isPrimary

          protected boolean isPrimary(String beanName,
                                      Object beanInstance)

      Return whether the bean definition for the given bean name has been marked as a primary bean.
      参数:
        `beanName` - the name of the bean
        `beanInstance` - the corresponding bean instance (can be null)
      返回:
        whether the given bean qualifies as primary

    - #### getPriority

          @Nullable
          protected Integer getPriority(Object beanInstance)

      Return the priority assigned for the given bean instance by the `javax.annotation.Priority` annotation.

      The default implementation delegates to the specified `dependency comparator`, checking its `method` if it is an extension of Spring's common `OrderComparator` - typically, an `AnnotationAwareOrderComparator`. If no such comparator is present, this implementation returns `null`.

      参数:
        `beanInstance` - the bean instance to check (can be `null`)
      返回:
        the priority assigned to that bean or `null` if none is set

    - #### matchesBeanName

          protected boolean matchesBeanName(String beanName,
                                            @Nullable
                                            String candidateName)

      Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.

    - #### toString

          public String toString()

      覆盖:
        `toString` 在类中 `Object`

    - #### writeReplace

          protected Object writeReplace()
                                 throws ObjectStreamException

      抛出:
        `ObjectStreamException`