您的位置:首页 > 编程语言 > Java开发

Spring4.0新特性--泛型依赖注入

2014-03-21 22:01 423 查看
1)Spring4.0可以为子类注入子类的泛型类型,成员变量的引用

  下面UML图来说名关系  

  

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"> 
<context:component-scan base-package="com.baba.miao.test.generic.di"></context:component-scan>
</beans>


beans-generic.xml
  好了通过上面的代码就可以说明问题了

                    

                本人是一个Java爱好者,欢迎交流

                             ----By 小苗
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: