open class BeanDefinitionDsl : ApplicationContextInitializer<GenericApplicationContext>
Class implementing functional bean definition Kotlin DSL.
enum class Role
Role enum constants. |
|
enum class Scope
Scope enum constants. |
BeanDefinitionDsl(init: BeanDefinitionDsl.() -> Unit, condition: (ConfigurableEnvironment) -> Boolean = { true })
Create a new bean definition DSL. |
val env: ConfigurableEnvironment
Shortcut for |
fun <T : Any> bean(name: String? = null, scope: BeanDefinitionDsl.Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: BeanDefinitionDsl.Role? = null): Unit
Declare a bean definition from the given bean class which can be inferred when possible. fun <T : Any> bean(name: String? = null, scope: BeanDefinitionDsl.Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: BeanDefinitionDsl.Role? = null, function: () -> T): Unit
Declare a bean definition using the given supplier for obtaining a new instance. |
|
fun environment(condition: ConfigurableEnvironment.() -> Boolean, init: BeanDefinitionDsl.() -> Unit): Unit
Take in account bean definitions enclosed in the provided lambda only when the specified environment-based predicate is true. |
|
open fun initialize(context: GenericApplicationContext): Unit
Register the bean defined via the DSL on the provided application context. |
|
fun profile(profile: String, init: BeanDefinitionDsl.() -> Unit): Unit
Take in account bean definitions enclosed in the provided lambda only when the specified profile is active. |
|
fun <T : Any> provider(): ObjectProvider<T>
Return an provider for the specified bean, allowing for lazy on-demand retrieval of instances, including availability and uniqueness options. |
|
fun <T : Any> ref(name: String? = null): T
Get a reference to the bean by type or type + name with the syntax
|