I use annotation-based wiring (i.e. @Configurable(autowire=Autowire.BY_TYPE) ) for this class, and I would like to associate all the beans of this type with it as a list:
application context:
<beans> <bean class="com.my.class.FirstConfigurer"/> <bean class="com.my.class.SecondConfigurer"/> </beans>
for auto connection:
@Configurable(autowire=Autowire.BY_TYPE) public class Target { ... public void setConfigurers(List<Configurer> configurers) { ... } }
All dependencies implement the common Configurer interface.
Is there a way to make this work to have all the dependencies of the type bundled together in the collection and enter where necessary, or should I define a <list> in XML or something else?
java spring spring-annotations
Naftuli Kay
source share