spring-framework
5.3.39

# BeanSupplierContext

open class BeanSupplierContext(context: GenericApplicationContext)
Content copied to clipboard

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

#### Since

5.2

## Constructors

BeanSupplierContext
Link copied to clipboard
fun BeanSupplierContext(context: GenericApplicationContext)
Content copied to clipboard

## Functions

provider
Link copied to clipboard
inline fun <T : Any> provider(): ObjectProvider<T>
Content copied to clipboard

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

ref
Link copied to clipboard
inline fun <T : Any> ref(name: String? = null): T
Content copied to clipboard

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")`.