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

bean

fun <reified T : Any> bean(name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition from the given bean class which can be inferred when possible.

Parameters

name - the name of the bean

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: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null, crossinline function: BeanSupplierContext.() -> T): Unit

Declare a bean definition using the given supplier for obtaining a new instance.

Parameters

name - the name of the bean

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

GenericApplicationContext.registerBean

org.springframework.beans.factory.config.BeanDefinition

inline fun <reified T : Any> bean(crossinline f: () -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with no parameter for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2.3

inline fun <reified T : Any, reified A : Any> bean(crossinline f: (A) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 1 parameter autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any> bean(crossinline f: (A, B) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 2 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any> bean(crossinline f: (A, B, C) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 3 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any> bean(crossinline f: (A, B, C, D) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 4 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any> bean(crossinline f: (A, B, C, D, E) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 5 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any> bean(crossinline f: (A, B, C, D, E, F) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 6 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any> bean(crossinline f: (A, B, C, D, E, F, G) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 7 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any> bean(crossinline f: (A, B, C, D, E, F, G, H) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 8 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 9 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 10 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 11 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 12 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any, reified M : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L, M) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 13 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any, reified M : Any, reified N : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 14 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any, reified M : Any, reified N : Any, reified O : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 15 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any, reified M : Any, reified N : Any, reified O : Any, reified P : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 16 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any, reified M : Any, reified N : Any, reified O : Any, reified P : Any, reified Q : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 17 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any, reified M : Any, reified N : Any, reified O : Any, reified P : Any, reified Q : Any, reified R : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 18 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any, reified M : Any, reified N : Any, reified O : Any, reified P : Any, reified Q : Any, reified R : Any, reified S : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 19 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any, reified M : Any, reified N : Any, reified O : Any, reified P : Any, reified Q : Any, reified R : Any, reified S : Any, reified U : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, U) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 20 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any, reified M : Any, reified N : Any, reified O : Any, reified P : Any, reified Q : Any, reified R : Any, reified S : Any, reified U : Any, reified V : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, U, V) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 21 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2

inline fun <reified T : Any, reified A : Any, reified B : Any, reified C : Any, reified D : Any, reified E : Any, reified F : Any, reified G : Any, reified H : Any, reified I : Any, reified J : Any, reified K : Any, reified L : Any, reified M : Any, reified N : Any, reified O : Any, reified P : Any, reified Q : Any, reified R : Any, reified S : Any, reified U : Any, reified V : Any, reified W : Any> bean(crossinline f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, U, V, W) -> T, name: String? = null, scope: Scope? = null, isLazyInit: Boolean? = null, isPrimary: Boolean? = null, isAutowireCandidate: Boolean? = null, initMethodName: String? = null, destroyMethodName: String? = null, description: String? = null, role: Role? = null): Unit

Declare a bean definition using the given callable reference with 22 parameters autowired by type for obtaining a new instance.

Parameters

f - the callable reference

name - the name of the bean

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

Since
5.2