Fix Kotlin example for dependency injection with static factory method
Closes gh-28589
This commit is contained in:
parent
290cc73d3d
commit
babff8e635
|
|
@ -1427,6 +1427,7 @@ The following example shows the corresponding `ExampleBean` class:
|
||||||
// a static factory method; the arguments to this method can be
|
// a static factory method; the arguments to this method can be
|
||||||
// considered the dependencies of the bean that is returned,
|
// considered the dependencies of the bean that is returned,
|
||||||
// regardless of how those arguments are actually used.
|
// regardless of how those arguments are actually used.
|
||||||
|
@JvmStatic
|
||||||
fun createInstance(anotherBean: AnotherBean, yetAnotherBean: YetAnotherBean, i: Int): ExampleBean {
|
fun createInstance(anotherBean: AnotherBean, yetAnotherBean: YetAnotherBean, i: Int): ExampleBean {
|
||||||
val eb = ExampleBean (...)
|
val eb = ExampleBean (...)
|
||||||
// some other operations...
|
// some other operations...
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue