You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/asciidoc/kotlin.adoc
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,9 +192,7 @@ how beans are registered.
192
192
----
193
193
fun beans() = beans {
194
194
bean<UserHandler>()
195
-
bean {
196
-
Routes(ref(), ref())
197
-
}
195
+
bean<Routes>()
198
196
bean<WebHandler>("webHandler") {
199
197
RouterFunctions.toWebHandler(
200
198
ref<Routes>().router(),
@@ -222,9 +220,7 @@ fun beans() = beans {
222
220
}
223
221
----
224
222
225
-
In this example, `Routes(ref(), ref())` is the equivalent of `Routes(ref<UserHandler>(), ref<MessageSource>())`
226
-
(types are not required thanks to Kotlin type inference) where `ref<UserHandler>()`
227
-
is a shortcut for `applicationContext.getBean(UserHandler::class.java)`.
223
+
In this example, `ref<Routes>()` is a shortcut for `applicationContext.getBean(Routes::class.java)`.
228
224
229
225
This `beans()` function can then be used to register beans on the application context.
230
226
@@ -242,7 +238,7 @@ This DSL is programmatic, thus it allows custom registration logic of beans
242
238
via an `if` expression, a `for` loop or any other Kotlin constructs.
243
239
====
244
240
245
-
See https://github.com/sdeleuze/spring-kotlin-functional/blob/3d12ab102c28f4761bd6a0736e2f585713eb2243/src/main/kotlin/functional/Beans.kt[spring-kotlin-functional beans declaration]
241
+
See https://github.com/sdeleuze/spring-kotlin-functional/blob/master/src/main/kotlin/functional/Beans.kt[spring-kotlin-functional beans declaration]
0 commit comments