spring-framework / org.springframework.beans.factory.config / ObjectFactoryCreatingFactoryBean / setTargetBeanName

setTargetBeanName

open fun setTargetBeanName(targetBeanName: String): Unit

Set the name of the target bean.

The target does not have to be a non-singleton bean, but realistically always will be (because if the target bean were a singleton, then said singleton bean could simply be injected straight into the dependent object, thus obviating the need for the extra level of indirection afforded by this factory approach).