关于java:spring自动装配构造函数

“autowire constructor” (with constructor arguments by type) behavior.Also applied if explicit constructor argument values are specified,matching all remaining arguments with beans from the bean factory.<p>This corresponds to constructor injection: In this mode, a Springbean factory is able to host components that expect constructor-baseddependency resolution.
“主动拆卸构造函数”(结构函数参数按类型)行为。如果指定了显式构造函数参数值,也能够利用,将所有残余的参数与来自bean工厂的bean匹配。这对应于构造函数注入:在这种模式下,一个Springbean factory可能托管冀望基于结构器的组件依赖性解析。org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#autowireConstructororg.springframework.beans.factory.support.ConstructorResolver#autowireConstructor

之前用BeanPostProcessor的形式解决

当初能够替换成这种

本文由博客群发一文多发等经营工具平台 OpenWrite 公布

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理