org.springframework.beans.factory.support

## 类 SimpleInstantiationStrategy

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

- 所有已实现的接口:
    InstantiationStrategy
  直接已知子类:
    CglibSubclassingInstantiationStrategy

      public class SimpleInstantiationStrategy
      extends Object
      implements InstantiationStrategy

  Simple object instantiation strategy for use in a BeanFactory.

  Does not support Method Injection, although it provides hooks for subclasses to override to add Method Injection support, for example by overriding methods.

  从以下版本开始:
    1.1
  作者:
    Rod Johnson, Juergen Hoeller

- - ### 构造器概要

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

  - ### 方法概要

    所有方法 静态方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static Method` | `getCurrentlyInvokedFactoryMethod()` Return the factory method currently being invoked or `null` if none.
    `Object` | `instantiate(RootBeanDefinition bd, String beanName, BeanFactory owner)` Return an instance of the bean with the given name in this factory.
    `Object` | `instantiate(RootBeanDefinition bd, String beanName, BeanFactory owner, Constructor<?> ctor, Object... args)` Return an instance of the bean with the given name in this factory, creating it via the given constructor.
    `Object` | `instantiate(RootBeanDefinition bd, String beanName, BeanFactory owner, Object factoryBean, Method factoryMethod, Object... args)` Return an instance of the bean with the given name in this factory, creating it via the given factory method.
    `protected Object` | `instantiateWithMethodInjection(RootBeanDefinition bd, String beanName, BeanFactory owner)` Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition.
    `protected Object` | `instantiateWithMethodInjection(RootBeanDefinition bd, String beanName, BeanFactory owner, Constructor<?> ctor, Object... args)` Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition.

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

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

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

    - #### SimpleInstantiationStrategy

          public SimpleInstantiationStrategy()

  - ### 方法详细资料

    - #### getCurrentlyInvokedFactoryMethod

          @Nullable
          public static Method getCurrentlyInvokedFactoryMethod()

      Return the factory method currently being invoked or `null` if none.

      Allows factory method implementations to determine whether the current caller is the container itself as opposed to user code.

    - #### instantiate

          public Object instantiate(RootBeanDefinition bd,
                                    @Nullable
                                    String beanName,
                                    BeanFactory owner)

      从接口复制的说明: `InstantiationStrategy`
      Return an instance of the bean with the given name in this factory.
      指定者:
        `instantiate` 在接口中 `InstantiationStrategy`
      参数:
        `bd` - the bean definition
        `beanName` - the name of the bean when it is created in this context. The name can be `null` if we are autowiring a bean which doesn't belong to the factory.
        `owner` - the owning BeanFactory
      返回:
        a bean instance for this bean definition

    - #### instantiateWithMethodInjection

          protected Object instantiateWithMethodInjection(RootBeanDefinition bd,
                                                          @Nullable
                                                          String beanName,
                                                          BeanFactory owner)

      Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition. Instantiation should use a no-arg constructor.

    - #### instantiate

          public Object instantiate(RootBeanDefinition bd,
                                    @Nullable
                                    String beanName,
                                    BeanFactory owner,
                                    Constructor<?> ctor,
                                    @Nullable
                                    Object... args)

      从接口复制的说明: `InstantiationStrategy`
      Return an instance of the bean with the given name in this factory, creating it via the given constructor.
      指定者:
        `instantiate` 在接口中 `InstantiationStrategy`
      参数:
        `bd` - the bean definition
        `beanName` - the name of the bean when it is created in this context. The name can be `null` if we are autowiring a bean which doesn't belong to the factory.
        `owner` - the owning BeanFactory
        `ctor` - the constructor to use
        `args` - the constructor arguments to apply
      返回:
        a bean instance for this bean definition

    - #### instantiateWithMethodInjection

          protected Object instantiateWithMethodInjection(RootBeanDefinition bd,
                                                          @Nullable
                                                          String beanName,
                                                          BeanFactory owner,
                                                          @Nullable
                                                          Constructor<?> ctor,
                                                          @Nullable
                                                          Object... args)

      Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition. Instantiation should use the given constructor and parameters.

    - #### instantiate

          public Object instantiate(RootBeanDefinition bd,
                                    @Nullable
                                    String beanName,
                                    BeanFactory owner,
                                    @Nullable
                                    Object factoryBean,
                                    Method factoryMethod,
                                    @Nullable
                                    Object... args)

      从接口复制的说明: `InstantiationStrategy`
      Return an instance of the bean with the given name in this factory, creating it via the given factory method.
      指定者:
        `instantiate` 在接口中 `InstantiationStrategy`
      参数:
        `bd` - the bean definition
        `beanName` - the name of the bean when it is created in this context. The name can be `null` if we are autowiring a bean which doesn't belong to the factory.
        `owner` - the owning BeanFactory
        `factoryBean` - the factory bean instance to call the factory method on, or `null` in case of a static factory method
        `factoryMethod` - the factory method to use
        `args` - the factory method arguments to apply
      返回:
        a bean instance for this bean definition