inline fun <reified 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.
scope
- Override the target scope of this bean, specifying a new scope name.
isLazyInit
- Set whether this bean should be lazily initialized.
isPrimary
- Set whether this bean is a primary autowire candidate.
isAutowireCandidate
- Set whether this bean is a candidate for getting
autowired into some other bean.
initMethodName
- Set the name of the initializer method
destroyMethodName
- Set the name of the destroy method
description
- Set a human-readable description of this bean definition
role
- Set the role hint for this bean definition
See Also
GenericApplicationContext.registerBean
org.springframework.beans.factory.config.BeanDefinition
inline fun <reified 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, crossinline function: () -> T): Unit
Declare a bean definition using the given supplier for obtaining a new instance.
scope
- Override the target scope of this bean, specifying a new scope name.
isLazyInit
- Set whether this bean should be lazily initialized.
isPrimary
- Set whether this bean is a primary autowire candidate.
isAutowireCandidate
- Set whether this bean is a candidate for getting
autowired into some other bean.
initMethodName
- Set the name of the initializer method
destroyMethodName
- Set the name of the destroy method
description
- Set a human-readable description of this bean definition
role
- Set the role hint for this bean definition
function
- the bean supplier function
See Also