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

Loading…
Cancel
Save