我最近在寻找关于加载时间编织和自动装配的不同问题的答案,我记得遇到过这样的问题,但我不知道如何配置它。基本上,我有我的控制之外创建的类实例,所以我需要加载时织入,以便在创建实例时自动连接我的依赖关系。但是,我想配置XML中的依赖项,因为它无法自动调用某个List
字段。在基于XML配置的注释类中连接依赖关系?
这是我想做什么:
@Configurable
public class RuntimeCreatedBean {
private List<RuntimeDependency> runtimeDependencies;
// setters omitted for brevity
}
XML:
<beans>
<bean class="RuntimeCreatedBean">
<property name="runtimeDependencies">
<list>
<bean class="RuntimeDependencyOne"/>
</list>
</property>
</bean>
</beans>
有没有办法做到这一点,这里的bean定义是用来接线RuntimeCreatedBean
?