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

BeanDefinitionDsl

open class BeanDefinitionDsl : ApplicationContextInitializer<GenericApplicationContext>

Class implementing functional bean definition Kotlin DSL.

Types

BeanSupplierContext

open class BeanSupplierContext

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

Role

enum class Role

Role enum constants.

Scope

enum class Scope

Scope enum constants.

Properties

env

val env: ConfigurableEnvironment

Shortcut for context.environment

Functions

bean

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: BeanDefinitionDsl.BeanSupplierContext.() -> T): Unit

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

fun <T : Any> bean(f: () -> T, 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 using the given callable reference with no parameter for obtaining a new instance.

fun <T : Any, A : Any> bean(f: (A) -> T, 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 using the given callable reference with 1 parameter autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any> bean(f: (A, B) -> T, 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 using the given callable reference with 2 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any> bean(f: (A, B, C) -> T, 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 using the given callable reference with 3 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any> bean(f: (A, B, C, D) -> T, 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 using the given callable reference with 4 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any> bean(f: (A, B, C, D, E) -> T, 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 using the given callable reference with 5 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any> bean(f: (A, B, C, D, E, F) -> T, 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 using the given callable reference with 6 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any> bean(f: (A, B, C, D, E, F, G) -> T, 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 using the given callable reference with 7 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any> bean(f: (A, B, C, D, E, F, G, H) -> T, 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 using the given callable reference with 8 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any> bean(f: (A, B, C, D, E, F, G, H, I) -> T, 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 using the given callable reference with 9 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any> bean(f: (A, B, C, D, E, F, G, H, I, J) -> T, 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 using the given callable reference with 10 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any> bean(f: (A, B, C, D, E, F, G, H, I, J, K) -> T, 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 using the given callable reference with 11 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any> bean(f: (A, B, C, D, E, F, G, H, I, J, K, L) -> T, 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 using the given callable reference with 12 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any, M : Any> bean(f: (A, B, C, D, E, F, G, H, I, J, K, L, M) -> T, 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 using the given callable reference with 13 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any, M : Any, N : Any> bean(f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N) -> T, 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 using the given callable reference with 14 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any, M : Any, N : Any, O : Any> bean(f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) -> T, 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 using the given callable reference with 15 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any, M : Any, N : Any, O : Any, P : Any> bean(f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) -> T, 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 using the given callable reference with 16 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any, M : Any, N : Any, O : Any, P : Any, Q : Any> bean(f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) -> T, 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 using the given callable reference with 17 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any, M : Any, N : Any, O : Any, P : Any, Q : Any, R : Any> bean(f: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) -> T, 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 using the given callable reference with 18 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any, M : Any, N : Any, O : Any, P : Any, Q : Any, R : Any, S : Any> bean(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: 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 using the given callable reference with 19 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any, M : Any, N : Any, O : Any, P : Any, Q : Any, R : Any, S : Any, U : Any> bean(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: 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 using the given callable reference with 20 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any, M : Any, N : Any, O : Any, P : Any, Q : Any, R : Any, S : Any, U : Any, V : Any> bean(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: 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 using the given callable reference with 21 parameters autowired by type for obtaining a new instance.

fun <T : Any, A : Any, B : Any, C : Any, D : Any, E : Any, F : Any, G : Any, H : Any, I : Any, J : Any, K : Any, L : Any, M : Any, N : Any, O : Any, P : Any, Q : Any, R : Any, S : Any, U : Any, V : Any, W : Any> bean(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: 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 using the given callable reference with 22 parameters autowired by type for obtaining a new instance.

environment

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.

initialize

open fun initialize(context: GenericApplicationContext): Unit

Register the bean defined via the DSL on the provided application context.

profile

fun profile(profile: String, init: BeanDefinitionDsl.() -> Unit): Unit

Take in account bean definitions enclosed in the provided lambda when the profile is accepted.