Skip to content

Commit fda9b9a

Browse files
committed
1 parent bedc235 commit fda9b9a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

framework-docs/modules/ROOT/pages/core/beans/java/programmatic-bean-registration.adoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
As of Spring Framework 7, a first-class support for programmatic bean registration is
55
provided via the {spring-framework-api}/beans/factory/BeanRegistrar.html[`BeanRegistrar`]
6-
interface that can be implemented to register beans programmatically in a concise and
7-
flexible way. For example, it allows custom registration through an `if` expression, a
8-
`for` loop, etc.
6+
interface that can be implemented to register beans programmatically in a flexible and
7+
efficient way.
98

109
Those bean registrar implementations are typically imported with an `@Import` annotation
1110
on `@Configuration` classes.
@@ -38,7 +37,8 @@ but also other variants) to conditionally import the related bean registrars.
3837

3938
The bean registrar implementation uses {spring-framework-api}/beans/factory/BeanRegistry.html[`BeanRegistry`] and
4039
{spring-framework-api}/core/env/Environment.html[`Environment`] APIs to register beans programmatically in a concise
41-
and flexible way.
40+
and flexible way. For example, it allows custom registration through an `if` expression, a
41+
`for` loop, etc.
4242

4343
[tabs]
4444
======
@@ -70,7 +70,7 @@ Kotlin::
7070
----
7171
class MyBeanRegistrar : BeanRegistrarDsl({
7272
registerBean<Foo>()
73-
registerBean<Bar>(
73+
registerBean(
7474
name = "bar",
7575
prototype = true,
7676
lazyInit = true,

spring-beans/src/main/kotlin/org/springframework/beans/factory/BeanRegistrarDsl.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import org.springframework.core.env.Environment
3737
* ```
3838
* class MyBeanRegistrar : BeanRegistrarDsl({
3939
* registerBean<Foo>()
40-
* registerBean<Bar>(
40+
* registerBean(
4141
* name = "bar",
4242
* prototype = true,
4343
* lazyInit = true,

spring-context/src/test/kotlin/org/springframework/context/annotation/BeanRegistrarDslConfigurationTests.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class BeanRegistrarDslConfigurationTests {
7474

7575
private class SampleBeanRegistrar : BeanRegistrarDsl({
7676
registerBean<Foo>()
77-
registerBean<Bar>(
77+
registerBean(
7878
name = "bar",
7979
prototype = true,
8080
lazyInit = true,

0 commit comments

Comments
 (0)