spring-framework / org.springframework.beans.factory.support / SimpleInstantiationStrategy

SimpleInstantiationStrategy

open class SimpleInstantiationStrategy : 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.

Author
Rod Johnson

Author
Juergen Hoeller

Since
1.1

Constructors

<init>

SimpleInstantiationStrategy()

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.

Functions

getCurrentlyInvokedFactoryMethod

open static fun getCurrentlyInvokedFactoryMethod(): Method

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

open fun instantiate(bd: RootBeanDefinition, beanName: String, owner: BeanFactory): Any
open fun instantiate(bd: RootBeanDefinition, beanName: String, owner: BeanFactory, ctor: Constructor<*>, vararg args: Any): Any
open fun instantiate(bd: RootBeanDefinition, beanName: String, owner: BeanFactory, factoryBean: Any, factoryMethod: Method, vararg args: Any): Any

Inheritors

CglibSubclassingInstantiationStrategy

open class CglibSubclassingInstantiationStrategy : SimpleInstantiationStrategy

Default object instantiation strategy for use in BeanFactories.

Uses CGLIB to generate subclasses dynamically if methods need to be overridden by the container to implement Method Injection.