spring-framework / org.springframework.context.support / BeanDefinitionDsl / BeanSupplierContext

BeanSupplierContext

open class BeanSupplierContext

Limit access to ref() and provider() to bean supplier lambdas.

Since
5.2

Constructors

<init>

Limit access to ref() and provider() to bean supplier lambdas.

BeanSupplierContext(context: GenericApplicationContext)

Functions

provider

Return an provider for the specified bean, allowing for lazy on-demand retrieval of instances, including availability and uniqueness options.

fun <T : Any> provider(): ObjectProvider<T>

ref

Get a reference to the bean by type or type + name with the syntax ref<Foo>() or ref<Foo>("foo"). When leveraging Kotlin type inference it could be as short as ref() or ref("foo").

fun <T : Any> ref(name: String? = null): T