Browse Source

Polish MyBeanRegistrar Kotlin code sample

pull/35696/head
Sébastien Deleuze 2 months ago
parent
commit
7e671abb9f
  1. 4
      framework-docs/src/main/kotlin/org/springframework/docs/core/beans/java/beansjavaprogrammaticregistration/MyBeanRegistrar.kt

4
framework-docs/src/main/kotlin/org/springframework/docs/core/beans/java/beansjavaprogrammaticregistration/MyBeanRegistrar.kt

@ -27,14 +27,14 @@ class MyBeanRegistrar : BeanRegistrarDsl({
prototype = true, prototype = true,
lazyInit = true, lazyInit = true,
description = "Custom description") { description = "Custom description") {
Bar(bean<Foo>()) Bar(bean<Foo>()) // Also possible with Bar(bean())
} }
profile("baz") { profile("baz") {
registerBean { Baz("Hello World!") } registerBean { Baz("Hello World!") }
} }
registerBean<MyRepository>() registerBean<MyRepository>()
registerBean { registerBean {
myRouter(bean<MyRepository>()) // Also possible with just myRouter(bean()) myRouter(bean<MyRepository>()) // Also possible with myRouter(bean())
} }
}) })

Loading…
Cancel
Save