spring源码测试

org.springframework.context.annotation.ComponentScanParserTests.componentScanWithAutowiredQualifier()

example.scannable.AutowiredQualifierFooService.fooDao

D:\workspacespring\spring-context\src\test\java\example\scannable\StubFooDao.java

 

AutowiredQualifierFooService中

@Autowired
//@Qualifier("testing")
private FooDao fooDao;

StubFooDao中

@Repository("wjDao")
//@Qualifier("testing")
public class StubFooDao implements FooDao {}

beanId和对应的bean如下:

wjDao example.scannable.StubFooDao

 

参考文档如下:

http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#beans-classpath-scanning

posted @ 2014-10-02 12:02  唾手可得的树  阅读(498)  评论(0编辑  收藏  举报