此版本仍在开发中,尚不被认为是稳定的。对于最新的稳定版本,请使用 Spring Framework 6.2.10spring-doc.cadn.net.cn

CustomAutowireConfigurer

CustomAutowireConfigurer是一个BeanFactoryPostProcessor允许您注册自己的自定义限定符 注释类型,即使它们没有用 Spring 的@Qualifier注解。 以下示例演示如何使用CustomAutowireConfigurer:spring-doc.cadn.net.cn

<bean id="customAutowireConfigurer"
		class="org.springframework.beans.factory.annotation.CustomAutowireConfigurer">
	<property name="customQualifierTypes">
		<set>
			<value>example.CustomQualifier</value>
		</set>
	</property>
</bean>

AutowireCandidateResolver通过以下方式确定自动配线候选者:spring-doc.cadn.net.cn

当多个 bean 符合自动连接候选项的条件时,“主”的确定是 如下所示:如果候选者中恰好有一个 bean 定义具有primary属性设置为true,则已选择。spring-doc.cadn.net.cn