org.springframework.beans.factory.support

## 类 AbstractBeanDefinition

- java.lang.Object
- - org.springframework.core.AttributeAccessorSupport
  - - org.springframework.beans.BeanMetadataAttributeAccessor
    - - org.springframework.beans.factory.support.AbstractBeanDefinition

- 所有已实现的接口:
    Serializable, Cloneable, BeanMetadataElement, BeanDefinition, org.springframework.core.AttributeAccessor
  直接已知子类:
    ChildBeanDefinition, GenericBeanDefinition, RootBeanDefinition

      public abstract class AbstractBeanDefinition
      extends BeanMetadataAttributeAccessor
      implements BeanDefinition, Cloneable

  Base class for concrete, full-fledged `BeanDefinition` classes, factoring out common properties of `GenericBeanDefinition`, `RootBeanDefinition`, and `ChildBeanDefinition`.

  The autowire constants match the ones defined in the `AutowireCapableBeanFactory` interface.

  作者:
    Rod Johnson, Juergen Hoeller, Rob Harrop, Mark Fisher
  另请参阅:
    `GenericBeanDefinition`, `RootBeanDefinition`, `ChildBeanDefinition`, 序列化表格

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static int` | `AUTOWIRE_AUTODETECT` 已过时。 as of Spring 3.0: If you are using mixed autowiring strategies, use annotation-based autowiring for clearer demarcation of autowiring needs.
    `static int` | `AUTOWIRE_BY_NAME` 根据名字自动装配 Constant that indicates autowiring bean properties by name.
    `static int` | `AUTOWIRE_BY_TYPE` 根据类型自动装配 Constant that indicates autowiring bean properties by type.
    `static int` | `AUTOWIRE_CONSTRUCTOR` 根据构造器装配 Constant that indicates autowiring a constructor.
    `static int` | `AUTOWIRE_NO` 默认根据@autowire手动装配 Constant that indicates no external autowiring at all.
    `static int` | `DEPENDENCY_CHECK_ALL` 对象属性和简单属性都检查依赖
    `static int` | `DEPENDENCY_CHECK_NONE` 不需要检查依赖
    `static int` | `DEPENDENCY_CHECK_OBJECTS` 检查对象引用的依赖
    `static int` | `DEPENDENCY_CHECK_SIMPLE` 简单属性的依赖
    `static String` | `INFER_METHOD` Constant that indicates the container should attempt to infer the `destroy method name` for a bean as opposed to explicit specification of a method name.
    `static String` | `SCOPE_DEFAULT` Constant for the default scope name: `""`, equivalent to singleton status unless overridden from a parent bean definition (if applicable).

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

      `ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON`

  - ### 构造器概要

    构造器
    限定符 | 构造器和说明
    --- | ---
    `protected` | `AbstractBeanDefinition()` Create a new AbstractBeanDefinition with default settings.
    `protected` | `AbstractBeanDefinition(BeanDefinition original)` Create a new AbstractBeanDefinition as a deep copy of the given bean definition.
    `protected` | `AbstractBeanDefinition(ConstructorArgumentValues cargs, MutablePropertyValues pvs)` Create a new AbstractBeanDefinition with the given constructor argument values and property values.

  - ### 方法概要

    所有方法 实例方法 抽象方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addQualifier(AutowireCandidateQualifier qualifier)` Register a qualifier to be used for autowire candidate resolution, keyed by the qualifier's type name.
    `void` | `applyDefaults(BeanDefinitionDefaults defaults)` Apply the provided default values to this bean.
    `Object` | `clone()` Public declaration of Object's `clone()` method.
    `abstract AbstractBeanDefinition` | `cloneBeanDefinition()` Clone this bean definition.
    `void` | `copyQualifiersFrom(AbstractBeanDefinition source)` Copy the qualifiers from the supplied AbstractBeanDefinition to this bean definition.
    `boolean` | `equals(Object other)`
    `int` | `getAutowireMode()` Return the autowire mode as specified in the bean definition.
    `Class<?>` | `getBeanClass()` Return the class of the wrapped bean (assuming it is resolved already).
    `String` | `getBeanClassName()` Return the current bean class name of this bean definition.
    `ConstructorArgumentValues` | `getConstructorArgumentValues()` Return constructor argument values for this bean (never `null`).
    `int` | `getDependencyCheck()` Return the dependency check code.
    `String[]` | `getDependsOn()` Return the bean names that this bean depends on.
    `String` | `getDescription()` Return a human-readable description of this bean definition.
    `String` | `getDestroyMethodName()` Return the name of the destroy method.
    `String` | `getFactoryBeanName()` Return the factory bean name, if any.
    `String` | `getFactoryMethodName()` Return a factory method, if any.
    `String` | `getInitMethodName()` Return the name of the initializer method.
    `Supplier<?>` | `getInstanceSupplier()` Return a callback for creating an instance of the bean, if any.
    `MethodOverrides` | `getMethodOverrides()` Return information about methods to be overridden by the IoC container.
    `BeanDefinition` | `getOriginatingBeanDefinition()` Return the originating BeanDefinition, or `null` if none.
    `MutablePropertyValues` | `getPropertyValues()` Return property values for this bean (never `null`).
    `AutowireCandidateQualifier` | `getQualifier(String typeName)` Return the qualifier mapped to the provided type name.
    `Set<AutowireCandidateQualifier>` | `getQualifiers()` Return all registered qualifiers.
    `int` | `getResolvedAutowireMode()` Return the resolved autowire code, (resolving AUTOWIRE_AUTODETECT to AUTOWIRE_CONSTRUCTOR or AUTOWIRE_BY_TYPE).
    `org.springframework.core.io.Resource` | `getResource()` Return the resource that this bean definition came from.
    `String` | `getResourceDescription()` Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
    `int` | `getRole()` Return the role hint for this `BeanDefinition`.
    `String` | `getScope()` Return the name of the target scope for the bean.
    `boolean` | `hasBeanClass()` Return whether this definition specifies a bean class.
    `boolean` | `hasConstructorArgumentValues()` Return if there are constructor argument values defined for this bean.
    `int` | `hashCode()`
    `boolean` | `hasMethodOverrides()` Return if there are method overrides defined for this bean.
    `boolean` | `hasPropertyValues()` Return if there are property values values defined for this bean.
    `boolean` | `hasQualifier(String typeName)` Return whether this bean has the specified qualifier.
    `boolean` | `isAbstract()` Return whether this bean is "abstract", i.e. not meant to be instantiated itself but rather just serving as parent for concrete child bean definitions.
    `boolean` | `isAutowireCandidate()` Return whether this bean is a candidate for getting autowired into some other bean.
    `boolean` | `isEnforceDestroyMethod()` Indicate whether the configured destroy method is the default.
    `boolean` | `isEnforceInitMethod()` Indicate whether the configured init method is the default.
    `boolean` | `isLazyInit()` Return whether this bean should be lazily initialized, i.e. not eagerly instantiated on startup.
    `boolean` | `isLenientConstructorResolution()` Return whether to resolve constructors in lenient mode or in strict mode.
    `boolean` | `isNonPublicAccessAllowed()` Return whether to allow access to non-public constructors and methods.
    `boolean` | `isPrimary()` Return whether this bean is a primary autowire candidate.
    `boolean` | `isPrototype()` Return whether this a Prototype, with an independent instance returned for each call.
    `boolean` | `isSingleton()` Return whether this a Singleton, with a single shared instance returned from all calls.
    `boolean` | `isSynthetic()` 是否是用户定义的而不是应用程序本身定义的 Return whether this bean definition is 'synthetic', that is, not defined by the application itself.
    `void` | `overrideFrom(BeanDefinition other)` Override settings in this bean definition (presumably a copied parent from a parent-child inheritance relationship) from the given bean definition (presumably the child).
    `protected void` | `prepareMethodOverride(MethodOverride mo)` Validate and prepare the given method override.
    `void` | `prepareMethodOverrides()` Validate and prepare the method overrides defined for this bean.
    `Class<?>` | `resolveBeanClass(ClassLoader classLoader)` Determine the class of the wrapped bean, resolving it from a specified class name if necessary.
    `void` | `setAbstract(boolean abstractFlag)` Set if this bean is "abstract", i.e. not meant to be instantiated itself but rather just serving as parent for concrete child bean definitions.
    `void` | `setAutowireCandidate(boolean autowireCandidate)` Set whether this bean is a candidate for getting autowired into some other bean.
    `void` | `setAutowireMode(int autowireMode)` Set the autowire mode.
    `void` | `setBeanClass(Class<?> beanClass)` Specify the class for this bean.
    `void` | `setBeanClassName(String beanClassName)` Specify the bean class name of this bean definition.
    `void` | `setConstructorArgumentValues(ConstructorArgumentValues constructorArgumentValues)` Specify constructor argument values for this bean.
    `void` | `setDependencyCheck(int dependencyCheck)` Set the dependency check code.
    `void` | `setDependsOn(String... dependsOn)` Set the names of the beans that this bean depends on being initialized.
    `void` | `setDescription(String description)` Set a human-readable description of this bean definition.
    `void` | `setDestroyMethodName(String destroyMethodName)` Set the name of the destroy method.
    `void` | `setEnforceDestroyMethod(boolean enforceDestroyMethod)` Specify whether or not the configured destroy method is the default.
    `void` | `setEnforceInitMethod(boolean enforceInitMethod)` Specify whether or not the configured init method is the default.
    `void` | `setFactoryBeanName(String factoryBeanName)` Specify the factory bean to use, if any.
    `void` | `setFactoryMethodName(String factoryMethodName)` Specify a factory method, if any.
    `void` | `setInitMethodName(String initMethodName)` Set the name of the initializer method.
    `void` | `setInstanceSupplier(Supplier<?> instanceSupplier)` Specify a callback for creating an instance of the bean, as an alternative to a declaratively specified factory method.
    `void` | `setLazyInit(boolean lazyInit)` Set whether this bean should be lazily initialized.
    `void` | `setLenientConstructorResolution(boolean lenientConstructorResolution)` Specify whether to resolve constructors in lenient mode (`true`, which is the default) or to switch to strict resolution (throwing an exception in case of ambiguous constructors that all match when converting the arguments, whereas lenient mode would use the one with the 'closest' type matches).
    `void` | `setMethodOverrides(MethodOverrides methodOverrides)` Specify method overrides for the bean, if any.
    `void` | `setNonPublicAccessAllowed(boolean nonPublicAccessAllowed)` Specify whether to allow access to non-public constructors and methods, for the case of externalized metadata pointing to those.
    `void` | `setOriginatingBeanDefinition(BeanDefinition originatingBd)` Set the originating (e.g. decorated) BeanDefinition, if any.
    `void` | `setPrimary(boolean primary)` Set whether this bean is a primary autowire candidate.
    `void` | `setPropertyValues(MutablePropertyValues propertyValues)` Specify property values for this bean, if any.
    `void` | `setResource(org.springframework.core.io.Resource resource)` Set the resource that this bean definition came from (for the purpose of showing context in case of errors).
    `void` | `setResourceDescription(String resourceDescription)` Set a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
    `void` | `setRole(int role)` Set the role hint for this `BeanDefinition`.
    `void` | `setScope(String scope)` Set the name of the target scope for the bean.
    `void` | `setSynthetic(boolean synthetic)` Set whether this bean definition is 'synthetic', that is, not defined by the application itself (for example, an infrastructure bean such as a helper for auto-proxying, created through `<aop:config>`).
    `String` | `toString()`
    `void` | `validate()` Validate this bean definition.

    - ### 从类继承的方法 org.springframework.beans.BeanMetadataAttributeAccessor

      `addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource`

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

      `attributeNames, copyAttributesFrom, hasAttribute`

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

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

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

      `getParentName, setParentName`

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

      `attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute`

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

      `getSource`

- - ### 字段详细资料

    - #### SCOPE_DEFAULT

          public static final String SCOPE_DEFAULT

      Constant for the default scope name: `""`, equivalent to singleton status unless overridden from a parent bean definition (if applicable).
      另请参阅:
        常量字段值

    - #### AUTOWIRE_NO

          public static final int AUTOWIRE_NO

      默认根据@autowire手动装配 Constant that indicates no external autowiring at all.
      另请参阅:
        `setAutowireMode(int)`, 常量字段值

    - #### AUTOWIRE_BY_NAME

          public static final int AUTOWIRE_BY_NAME

      根据名字自动装配 Constant that indicates autowiring bean properties by name.
      另请参阅:
        `setAutowireMode(int)`, 常量字段值

    - #### AUTOWIRE_BY_TYPE

          public static final int AUTOWIRE_BY_TYPE

      根据类型自动装配 Constant that indicates autowiring bean properties by type.
      另请参阅:
        `setAutowireMode(int)`, 常量字段值

    - #### AUTOWIRE_CONSTRUCTOR

          public static final int AUTOWIRE_CONSTRUCTOR

      根据构造器装配 Constant that indicates autowiring a constructor.
      另请参阅:
        `setAutowireMode(int)`, 常量字段值

    - #### AUTOWIRE_AUTODETECT

          @Deprecated
          public static final int AUTOWIRE_AUTODETECT

      已过时。 as of Spring 3.0: If you are using mixed autowiring strategies, use annotation-based autowiring for clearer demarcation of autowiring needs.
      Constant that indicates determining an appropriate autowire strategy through introspection of the bean class.
      另请参阅:
        `setAutowireMode(int)`, 常量字段值

    - #### DEPENDENCY_CHECK_NONE

          public static final int DEPENDENCY_CHECK_NONE

      不需要检查依赖
      另请参阅:
        `setDependencyCheck(int)`, 常量字段值

    - #### DEPENDENCY_CHECK_OBJECTS

          public static final int DEPENDENCY_CHECK_OBJECTS

      检查对象引用的依赖
      另请参阅:
        `setDependencyCheck(int)`, 常量字段值

    - #### DEPENDENCY_CHECK_SIMPLE

          public static final int DEPENDENCY_CHECK_SIMPLE

      简单属性的依赖
      另请参阅:
        `setDependencyCheck(int)`, `BeanUtils.isSimpleProperty(java.lang.Class<?>)`, 常量字段值

    - #### DEPENDENCY_CHECK_ALL

          public static final int DEPENDENCY_CHECK_ALL

      对象属性和简单属性都检查依赖
      另请参阅:
        `setDependencyCheck(int)`, 常量字段值

    - #### INFER_METHOD

          public static final String INFER_METHOD

      Constant that indicates the container should attempt to infer the `destroy method name` for a bean as opposed to explicit specification of a method name. The value "(inferred)" is specifically designed to include characters otherwise illegal in a method name, ensuring no possibility of collisions with legitimately named methods having the same name.

      Currently, the method names detected during destroy method inference are "close" and "shutdown", if present on the specific bean class.

      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### AbstractBeanDefinition

          protected AbstractBeanDefinition()

      Create a new AbstractBeanDefinition with default settings.

    - #### AbstractBeanDefinition

          protected AbstractBeanDefinition(@Nullable
                                           ConstructorArgumentValues cargs,
                                           @Nullable
                                           MutablePropertyValues pvs)

      Create a new AbstractBeanDefinition with the given constructor argument values and property values.

    - #### AbstractBeanDefinition

          protected AbstractBeanDefinition(BeanDefinition original)

      Create a new AbstractBeanDefinition as a deep copy of the given bean definition.
      参数:
        `original` - the original bean definition to copy from

  - ### 方法详细资料

    - #### overrideFrom

          public void overrideFrom(BeanDefinition other)

      Override settings in this bean definition (presumably a copied parent from a parent-child inheritance relationship) from the given bean definition (presumably the child).
      - Will override beanClass if specified in the given bean definition.
      - Will always take `abstract`, `scope`, `lazyInit`, `autowireMode`, `dependencyCheck`, and `dependsOn` from the given bean definition.
      - Will add `constructorArgumentValues`, `propertyValues`, `methodOverrides` from the given bean definition to existing ones.
      - Will override `factoryBeanName`, `factoryMethodName`, `initMethodName`, and `destroyMethodName` if specified in the given bean definition.

    - #### applyDefaults

          public void applyDefaults(BeanDefinitionDefaults defaults)

      Apply the provided default values to this bean.
      参数:
        `defaults` - the default settings to apply
      从以下版本开始:
        2.5

    - #### setBeanClassName

          public void setBeanClassName(@Nullable
                                       String beanClassName)

      Specify the bean class name of this bean definition.
      指定者:
        `setBeanClassName` 在接口中 `BeanDefinition`
      另请参阅:
        `BeanDefinition.setParentName(java.lang.String)`, `BeanDefinition.setFactoryBeanName(java.lang.String)`, `BeanDefinition.setFactoryMethodName(java.lang.String)`

    - #### getBeanClassName

          @Nullable
          public String getBeanClassName()

      Return the current bean class name of this bean definition.
      指定者:
        `getBeanClassName` 在接口中 `BeanDefinition`
      另请参阅:
        `BeanDefinition.getParentName()`, `BeanDefinition.getFactoryBeanName()`, `BeanDefinition.getFactoryMethodName()`

    - #### setBeanClass

          public void setBeanClass(@Nullable
                                   Class<?> beanClass)

      Specify the class for this bean.

    - #### getBeanClass

          public Class<?> getBeanClass()
                                throws IllegalStateException

      Return the class of the wrapped bean (assuming it is resolved already).
      返回:
        the bean class (never `null`)
      抛出:
        `IllegalStateException` - if the bean definition does not define a bean class, or a specified bean class name has not been resolved into an actual Class yet
      另请参阅:
        `hasBeanClass()`, `setBeanClass(Class)`, `resolveBeanClass(ClassLoader)`

    - #### hasBeanClass

          public boolean hasBeanClass()

      Return whether this definition specifies a bean class.
      另请参阅:
        `getBeanClass()`, `setBeanClass(Class)`, `resolveBeanClass(ClassLoader)`

    - #### resolveBeanClass

          @Nullable
          public Class<?> resolveBeanClass(@Nullable
                                                      ClassLoader classLoader)
                                               throws ClassNotFoundException

      Determine the class of the wrapped bean, resolving it from a specified class name if necessary. Will also reload a specified Class from its name when called with the bean class already resolved.
      参数:
        `classLoader` - the ClassLoader to use for resolving a (potential) class name
      返回:
        the resolved bean class
      抛出:
        `ClassNotFoundException` - if the class name could be resolved

    - #### setScope

          public void setScope(@Nullable
                               String scope)

      Set the name of the target scope for the bean.

      The default is singleton status, although this is only applied once a bean definition becomes active in the containing factory. A bean definition may eventually inherit its scope from a parent bean definition. For this reason, the default scope name is an empty string (i.e., `""`), with singleton status being assumed until a resolved scope is set.

      指定者:
        `setScope` 在接口中 `BeanDefinition`
      另请参阅:
        `BeanDefinition.SCOPE_SINGLETON`, `BeanDefinition.SCOPE_PROTOTYPE`

    - #### getScope

          @Nullable
          public String getScope()

      Return the name of the target scope for the bean.
      指定者:
        `getScope` 在接口中 `BeanDefinition`

    - #### isSingleton

          public boolean isSingleton()

      Return whether this a Singleton, with a single shared instance returned from all calls.
      指定者:
        `isSingleton` 在接口中 `BeanDefinition`
      另请参阅:
        `BeanDefinition.SCOPE_SINGLETON`

    - #### isPrototype

          public boolean isPrototype()

      Return whether this a Prototype, with an independent instance returned for each call.
      指定者:
        `isPrototype` 在接口中 `BeanDefinition`
      另请参阅:
        `BeanDefinition.SCOPE_PROTOTYPE`

    - #### setAbstract

          public void setAbstract(boolean abstractFlag)

      Set if this bean is "abstract", i.e. not meant to be instantiated itself but rather just serving as parent for concrete child bean definitions.

      Default is "false". Specify true to tell the bean factory to not try to instantiate that particular bean in any case.

    - #### isAbstract

          public boolean isAbstract()

      Return whether this bean is "abstract", i.e. not meant to be instantiated itself but rather just serving as parent for concrete child bean definitions.
      指定者:
        `isAbstract` 在接口中 `BeanDefinition`

    - #### setLazyInit

          public void setLazyInit(boolean lazyInit)

      Set whether this bean should be lazily initialized.

      If `false`, the bean will get instantiated on startup by bean factories that perform eager initialization of singletons.

      指定者:
        `setLazyInit` 在接口中 `BeanDefinition`

    - #### isLazyInit

          public boolean isLazyInit()

      Return whether this bean should be lazily initialized, i.e. not eagerly instantiated on startup. Only applicable to a singleton bean.
      指定者:
        `isLazyInit` 在接口中 `BeanDefinition`
      返回:
        whether to apply lazy-init semantics (`false` by default)

    - #### setAutowireMode

          public void setAutowireMode(int autowireMode)

      Set the autowire mode. This determines whether any automagical detection and setting of bean references will happen. Default is AUTOWIRE_NO which means there won't be convention-based autowiring by name or type (however, there may still be explicit annotation-driven autowiring).
      参数:
        `autowireMode` - the autowire mode to set. Must be one of the constants defined in this class.
      另请参阅:
        `AUTOWIRE_NO`, `AUTOWIRE_BY_NAME`, `AUTOWIRE_BY_TYPE`, `AUTOWIRE_CONSTRUCTOR`, `AUTOWIRE_AUTODETECT`

    - #### getAutowireMode

          public int getAutowireMode()

      Return the autowire mode as specified in the bean definition.

    - #### getResolvedAutowireMode

          public int getResolvedAutowireMode()

      Return the resolved autowire code, (resolving AUTOWIRE_AUTODETECT to AUTOWIRE_CONSTRUCTOR or AUTOWIRE_BY_TYPE).
      另请参阅:
        `AUTOWIRE_AUTODETECT`, `AUTOWIRE_CONSTRUCTOR`, `AUTOWIRE_BY_TYPE`

    - #### setDependencyCheck

          public void setDependencyCheck(int dependencyCheck)

      Set the dependency check code.
      参数:
        `dependencyCheck` - the code to set. Must be one of the four constants defined in this class.
      另请参阅:
        `DEPENDENCY_CHECK_NONE`, `DEPENDENCY_CHECK_OBJECTS`, `DEPENDENCY_CHECK_SIMPLE`, `DEPENDENCY_CHECK_ALL`

    - #### getDependencyCheck

          public int getDependencyCheck()

      Return the dependency check code.

    - #### setDependsOn

          public void setDependsOn(@Nullable
                                   String... dependsOn)

      Set the names of the beans that this bean depends on being initialized. The bean factory will guarantee that these beans get initialized first.

      Note that dependencies are normally expressed through bean properties or constructor arguments. This property should just be necessary for other kinds of dependencies like statics (*ugh*) or database preparation on startup.

      指定者:
        `setDependsOn` 在接口中 `BeanDefinition`

    - #### getDependsOn

          @Nullable
          public String[] getDependsOn()

      Return the bean names that this bean depends on.
      指定者:
        `getDependsOn` 在接口中 `BeanDefinition`

    - #### setAutowireCandidate

          public void setAutowireCandidate(boolean autowireCandidate)

      Set whether this bean is a candidate for getting autowired into some other bean.

      Note that this flag is designed to only affect type-based autowiring. It does not affect explicit references by name, which will get resolved even if the specified bean is not marked as an autowire candidate. As a consequence, autowiring by name will nevertheless inject a bean if the name matches.

      指定者:
        `setAutowireCandidate` 在接口中 `BeanDefinition`
      另请参阅:
        `AUTOWIRE_BY_TYPE`, `AUTOWIRE_BY_NAME`

    - #### isAutowireCandidate

          public boolean isAutowireCandidate()

      Return whether this bean is a candidate for getting autowired into some other bean.
      指定者:
        `isAutowireCandidate` 在接口中 `BeanDefinition`

    - #### setPrimary

          public void setPrimary(boolean primary)

      Set whether this bean is a primary autowire candidate.

      If this value is `true` for exactly one bean among multiple matching candidates, it will serve as a tie-breaker.

      指定者:
        `setPrimary` 在接口中 `BeanDefinition`

    - #### isPrimary

          public boolean isPrimary()

      Return whether this bean is a primary autowire candidate.
      指定者:
        `isPrimary` 在接口中 `BeanDefinition`

    - #### addQualifier

          public void addQualifier(AutowireCandidateQualifier qualifier)

      Register a qualifier to be used for autowire candidate resolution, keyed by the qualifier's type name.
      另请参阅:
        `AutowireCandidateQualifier.getTypeName()`

    - #### hasQualifier

          public boolean hasQualifier(String typeName)

      Return whether this bean has the specified qualifier.

    - #### getQualifier

          @Nullable
          public AutowireCandidateQualifier getQualifier(String typeName)

      Return the qualifier mapped to the provided type name.

    - #### getQualifiers

          public Set<AutowireCandidateQualifier> getQualifiers()

      Return all registered qualifiers.
      返回:
        the Set of `AutowireCandidateQualifier` objects.

    - #### copyQualifiersFrom

          public void copyQualifiersFrom(AbstractBeanDefinition source)

      Copy the qualifiers from the supplied AbstractBeanDefinition to this bean definition.
      参数:
        `source` - the AbstractBeanDefinition to copy from

    - #### setInstanceSupplier

          public void setInstanceSupplier(@Nullable
                                          Supplier<?> instanceSupplier)

      Specify a callback for creating an instance of the bean, as an alternative to a declaratively specified factory method.

      If such a callback is set, it will override any other constructor or factory method metadata. However, bean property population and potential annotation-driven injection will still apply as usual.

      从以下版本开始:
        5.0
      另请参阅:
        `setConstructorArgumentValues(ConstructorArgumentValues)`, `setPropertyValues(MutablePropertyValues)`

    - #### getInstanceSupplier

          @Nullable
          public Supplier<?> getInstanceSupplier()

      Return a callback for creating an instance of the bean, if any.
      从以下版本开始:
        5.0

    - #### setNonPublicAccessAllowed

          public void setNonPublicAccessAllowed(boolean nonPublicAccessAllowed)

      Specify whether to allow access to non-public constructors and methods, for the case of externalized metadata pointing to those. The default is `true`; switch this to `false` for public access only.

      This applies to constructor resolution, factory method resolution, and also init/destroy methods. Bean property accessors have to be public in any case and are not affected by this setting.

      Note that annotation-driven configuration will still access non-public members as far as they have been annotated. This setting applies to externalized metadata in this bean definition only.

    - #### isNonPublicAccessAllowed

          public boolean isNonPublicAccessAllowed()

      Return whether to allow access to non-public constructors and methods.

    - #### setLenientConstructorResolution

          public void setLenientConstructorResolution(boolean lenientConstructorResolution)

      Specify whether to resolve constructors in lenient mode (`true`, which is the default) or to switch to strict resolution (throwing an exception in case of ambiguous constructors that all match when converting the arguments, whereas lenient mode would use the one with the 'closest' type matches).

    - #### isLenientConstructorResolution

          public boolean isLenientConstructorResolution()

      Return whether to resolve constructors in lenient mode or in strict mode.

    - #### setFactoryBeanName

          public void setFactoryBeanName(@Nullable
                                         String factoryBeanName)

      Specify the factory bean to use, if any. This the name of the bean to call the specified factory method on.
      指定者:
        `setFactoryBeanName` 在接口中 `BeanDefinition`
      另请参阅:
        `setFactoryMethodName(java.lang.String)`

    - #### getFactoryBeanName

          @Nullable
          public String getFactoryBeanName()

      Return the factory bean name, if any.
      指定者:
        `getFactoryBeanName` 在接口中 `BeanDefinition`

    - #### setFactoryMethodName

          public void setFactoryMethodName(@Nullable
                                           String factoryMethodName)

      Specify a factory method, if any. This method will be invoked with constructor arguments, or with no arguments if none are specified. The method will be invoked on the specified factory bean, if any, or otherwise as a static method on the local bean class.
      指定者:
        `setFactoryMethodName` 在接口中 `BeanDefinition`
      另请参阅:
        `setFactoryBeanName(java.lang.String)`, `setBeanClassName(java.lang.String)`

    - #### getFactoryMethodName

          @Nullable
          public String getFactoryMethodName()

      Return a factory method, if any.
      指定者:
        `getFactoryMethodName` 在接口中 `BeanDefinition`

    - #### setConstructorArgumentValues

          public void setConstructorArgumentValues(ConstructorArgumentValues constructorArgumentValues)

      Specify constructor argument values for this bean.

    - #### getConstructorArgumentValues

          public ConstructorArgumentValues getConstructorArgumentValues()

      Return constructor argument values for this bean (never `null`).
      指定者:
        `getConstructorArgumentValues` 在接口中 `BeanDefinition`
      返回:
        the ConstructorArgumentValues object (never `null`)

    - #### hasConstructorArgumentValues

          public boolean hasConstructorArgumentValues()

      Return if there are constructor argument values defined for this bean.
      指定者:
        `hasConstructorArgumentValues` 在接口中 `BeanDefinition`

    - #### setPropertyValues

          public void setPropertyValues(MutablePropertyValues propertyValues)

      Specify property values for this bean, if any.

    - #### getPropertyValues

          public MutablePropertyValues getPropertyValues()

      Return property values for this bean (never `null`).
      指定者:
        `getPropertyValues` 在接口中 `BeanDefinition`
      返回:
        the MutablePropertyValues object (never `null`)

    - #### hasPropertyValues

          public boolean hasPropertyValues()

      Return if there are property values values defined for this bean.
      指定者:
        `hasPropertyValues` 在接口中 `BeanDefinition`
      从以下版本开始:
        5.0.2

    - #### setMethodOverrides

          public void setMethodOverrides(MethodOverrides methodOverrides)

      Specify method overrides for the bean, if any.

    - #### getMethodOverrides

          public MethodOverrides getMethodOverrides()

      Return information about methods to be overridden by the IoC container. This will be empty if there are no method overrides.

      Never returns `null`.

    - #### hasMethodOverrides

          public boolean hasMethodOverrides()

      Return if there are method overrides defined for this bean.
      从以下版本开始:
        5.0.2

    - #### setInitMethodName

          public void setInitMethodName(@Nullable
                                        String initMethodName)

      Set the name of the initializer method.

      The default is `null` in which case there is no initializer method.

    - #### getInitMethodName

          @Nullable
          public String getInitMethodName()

      Return the name of the initializer method.

    - #### setEnforceInitMethod

          public void setEnforceInitMethod(boolean enforceInitMethod)

      Specify whether or not the configured init method is the default.

      The default value is `false`.

      另请参阅:
        `setInitMethodName(java.lang.String)`

    - #### isEnforceInitMethod

          public boolean isEnforceInitMethod()

      Indicate whether the configured init method is the default.
      另请参阅:
        `getInitMethodName()`

    - #### setDestroyMethodName

          public void setDestroyMethodName(@Nullable
                                           String destroyMethodName)

      Set the name of the destroy method.

      The default is `null` in which case there is no destroy method.

    - #### getDestroyMethodName

          @Nullable
          public String getDestroyMethodName()

      Return the name of the destroy method.

    - #### setEnforceDestroyMethod

          public void setEnforceDestroyMethod(boolean enforceDestroyMethod)

      Specify whether or not the configured destroy method is the default.

      The default value is `false`.

      另请参阅:
        `setDestroyMethodName(java.lang.String)`

    - #### isEnforceDestroyMethod

          public boolean isEnforceDestroyMethod()

      Indicate whether the configured destroy method is the default.
      另请参阅:
        `getDestroyMethodName()`

    - #### setSynthetic

          public void setSynthetic(boolean synthetic)

      Set whether this bean definition is 'synthetic', that is, not defined by the application itself (for example, an infrastructure bean such as a helper for auto-proxying, created through `<aop:config>`).

    - #### isSynthetic

          public boolean isSynthetic()

      是否是用户定义的而不是应用程序本身定义的 Return whether this bean definition is 'synthetic', that is, not defined by the application itself.

    - #### setRole

          public void setRole(int role)

      Set the role hint for this `BeanDefinition`.

    - #### getRole

          public int getRole()

      Return the role hint for this `BeanDefinition`.
      指定者:
        `getRole` 在接口中 `BeanDefinition`
      另请参阅:
        `BeanDefinition.ROLE_APPLICATION`, `BeanDefinition.ROLE_SUPPORT`, `BeanDefinition.ROLE_INFRASTRUCTURE`

    - #### setDescription

          public void setDescription(@Nullable
                                     String description)

      Set a human-readable description of this bean definition.

    - #### getDescription

          @Nullable
          public String getDescription()

      Return a human-readable description of this bean definition.
      指定者:
        `getDescription` 在接口中 `BeanDefinition`

    - #### setResource

          public void setResource(@Nullable
                                  org.springframework.core.io.Resource resource)

      Set the resource that this bean definition came from (for the purpose of showing context in case of errors).

    - #### getResource

          @Nullable
          public org.springframework.core.io.Resource getResource()

      Return the resource that this bean definition came from.

    - #### setResourceDescription

          public void setResourceDescription(@Nullable
                                             String resourceDescription)

      Set a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).

    - #### getResourceDescription

          @Nullable
          public String getResourceDescription()

      Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
      指定者:
        `getResourceDescription` 在接口中 `BeanDefinition`

    - #### setOriginatingBeanDefinition

          public void setOriginatingBeanDefinition(BeanDefinition originatingBd)

      Set the originating (e.g. decorated) BeanDefinition, if any.

    - #### getOriginatingBeanDefinition

          @Nullable
          public BeanDefinition getOriginatingBeanDefinition()

      Return the originating BeanDefinition, or `null` if none. Allows for retrieving the decorated bean definition, if any.

      Note that this method returns the immediate originator. Iterate through the originator chain to find the original BeanDefinition as defined by the user.

      指定者:
        `getOriginatingBeanDefinition` 在接口中 `BeanDefinition`

    - #### validate

          public void validate()
                        throws BeanDefinitionValidationException

      Validate this bean definition.
      抛出:
        `BeanDefinitionValidationException` - in case of validation failure

    - #### prepareMethodOverrides

          public void prepareMethodOverrides()
                                      throws BeanDefinitionValidationException

      Validate and prepare the method overrides defined for this bean. Checks for existence of a method with the specified name.
      抛出:
        `BeanDefinitionValidationException` - in case of validation failure

    - #### prepareMethodOverride

          protected void prepareMethodOverride(MethodOverride mo)
                                        throws BeanDefinitionValidationException

      Validate and prepare the given method override. Checks for existence of a method with the specified name, marking it as not overloaded if none found.
      参数:
        `mo` - the MethodOverride object to validate
      抛出:
        `BeanDefinitionValidationException` - in case of validation failure

    - #### clone

          public Object clone()

      Public declaration of Object's `clone()` method. Delegates to `cloneBeanDefinition()`.
      覆盖:
        `clone` 在类中 `Object`
      另请参阅:
        `Object.clone()`

    - #### cloneBeanDefinition

          public abstract AbstractBeanDefinition cloneBeanDefinition()

      Clone this bean definition. To be implemented by concrete subclasses.
      返回:
        the cloned bean definition object

    - #### equals

          public boolean equals(Object other)

      覆盖:
        `equals` 在类中 `org.springframework.core.AttributeAccessorSupport`

    - #### hashCode

          public int hashCode()

      覆盖:
        `hashCode` 在类中 `org.springframework.core.AttributeAccessorSupport`

    - #### toString

          public String toString()

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