org.springframework.beans.factory.support

## 类 BeanDefinitionReaderUtils

- java.lang.Object
- - org.springframework.beans.factory.support.BeanDefinitionReaderUtils

-     public class BeanDefinitionReaderUtils
      extends Object

  Utility methods that are useful for bean definition reader implementations. Mainly intended for internal use.
  从以下版本开始:
    1.1
  作者:
    Juergen Hoeller, Rob Harrop
  另请参阅:
    `PropertiesBeanDefinitionReader`, `DefaultBeanDefinitionDocumentReader`

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String` | `GENERATED_BEAN_NAME_SEPARATOR` Separator for generated bean names.

  - ### 构造器概要

    构造器
    构造器和说明
    `BeanDefinitionReaderUtils()`

  - ### 方法概要

    所有方法 静态方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static AbstractBeanDefinition` | `createBeanDefinition(String parentName, String className, ClassLoader classLoader)` Create a new GenericBeanDefinition for the given parent name and class name, eagerly loading the bean class if a ClassLoader has been specified.
    `static String` | `generateBeanName(BeanDefinition beanDefinition, BeanDefinitionRegistry registry)` Generate a bean name for the given top-level bean definition, unique within the given bean factory.
    `static String` | `generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry, boolean isInnerBean)` Generate a bean name for the given bean definition, unique within the given bean factory.
    `static void` | `registerBeanDefinition(BeanDefinitionHolder definitionHolder, BeanDefinitionRegistry registry)` Register the given bean definition with the given bean factory.
    `static String` | `registerWithGeneratedName(AbstractBeanDefinition definition, BeanDefinitionRegistry registry)` Register the given bean definition with a generated name, unique within the given bean factory.

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

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

- - ### 字段详细资料

    - #### GENERATED_BEAN_NAME_SEPARATOR

          public static final String GENERATED_BEAN_NAME_SEPARATOR

      Separator for generated bean names. If a class name or parent name is not unique, "#1", "#2" etc will be appended, until the name becomes unique.
      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### BeanDefinitionReaderUtils

          public BeanDefinitionReaderUtils()

  - ### 方法详细资料

    - #### createBeanDefinition

          public static AbstractBeanDefinition createBeanDefinition(@Nullable
                                                                    String parentName,
                                                                    @Nullable
                                                                    String className,
                                                                    @Nullable
                                                                    ClassLoader classLoader)
                                                             throws ClassNotFoundException

      Create a new GenericBeanDefinition for the given parent name and class name, eagerly loading the bean class if a ClassLoader has been specified.
      参数:
        `parentName` - the name of the parent bean, if any
        `className` - the name of the bean class, if any
        `classLoader` - the ClassLoader to use for loading bean classes (can be `null` to just register bean classes by name)
      返回:
        the bean definition
      抛出:
        `ClassNotFoundException` - if the bean class could not be loaded

    - #### generateBeanName

          public static String generateBeanName(BeanDefinition beanDefinition,
                                                BeanDefinitionRegistry registry)
                                         throws BeanDefinitionStoreException

      Generate a bean name for the given top-level bean definition, unique within the given bean factory.
      参数:
        `beanDefinition` - the bean definition to generate a bean name for
        `registry` - the bean factory that the definition is going to be registered with (to check for existing bean names)
      返回:
        the generated bean name
      抛出:
        `BeanDefinitionStoreException` - if no unique name can be generated for the given bean definition
      另请参阅:
        `generateBeanName(BeanDefinition, BeanDefinitionRegistry, boolean)`

    - #### generateBeanName

          public static String generateBeanName(BeanDefinition definition,
                                                BeanDefinitionRegistry registry,
                                                boolean isInnerBean)
                                         throws BeanDefinitionStoreException

      Generate a bean name for the given bean definition, unique within the given bean factory.
      参数:
        `definition` - the bean definition to generate a bean name for
        `registry` - the bean factory that the definition is going to be registered with (to check for existing bean names)
        `isInnerBean` - whether the given bean definition will be registered as inner bean or as top-level bean (allowing for special name generation for inner beans versus top-level beans)
      返回:
        the generated bean name
      抛出:
        `BeanDefinitionStoreException` - if no unique name can be generated for the given bean definition

    - #### registerBeanDefinition

          public static void registerBeanDefinition(BeanDefinitionHolder definitionHolder,
                                                    BeanDefinitionRegistry registry)
                                             throws BeanDefinitionStoreException

      Register the given bean definition with the given bean factory.
      参数:
        `definitionHolder` - the bean definition including name and aliases
        `registry` - the bean factory to register with
      抛出:
        `BeanDefinitionStoreException` - if registration failed

    - #### registerWithGeneratedName

          public static String registerWithGeneratedName(AbstractBeanDefinition definition,
                                                         BeanDefinitionRegistry registry)
                                                  throws BeanDefinitionStoreException

      Register the given bean definition with a generated name, unique within the given bean factory.
      参数:
        `definition` - the bean definition to generate a bean name for
        `registry` - the bean factory to register with
      返回:
        the generated bean name
      抛出:
        `BeanDefinitionStoreException` - if no unique name can be generated for the given bean definition or the definition cannot be registered