目录:

1.applicationContext.xml配置文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--注入bean
id相当于当前bean唯一标识
class是bean 的全路径
property注入bean中的属性 必须封装
-->
<!--注入墨盒-->
<bean id="colorInk" class="cn.spring.print.ink.ColorInk"></bean>
<bean id="blackWhiteInk" class="cn.spring.print.ink.BlackWhiteInk"></bean>
<!--注入纸张-->
<bean id="a4Paper" class="cn.spring.print.paper.A4Paper"></bean>
<bean id="b5Paper" class="cn.spring.print.paper.B5Paper"></bean>
<!--打印机-->
<bean id="printer" class="cn.spring.print.printer.Printer">
<!--将墨盒纸张组合起来-->
<property name="paper" ref="b5Paper"></property>
<property name="ink" ref="colorInk"></property>
</bean>
</beans>

2.墨盒接口  Ink

   

3.黑白墨盒实现类 BlackWhiteInk

    

4.彩色墨盒实现类 ColorInk

   

5.纸张接口  Paper

  

6. A4纸张实现类   A4Paper

  

7. B5纸张实现类  B5Paper

  

8.   打印机类 Printer

  

9.  测试类  PrintTest

  

最新文章

  1. Chrome 开发工具之Sources
  2. ttf文件属性详细信息
  3. Excel表格导入数据
  4. nodeType的返回
  5. java12-6 冒泡排序法和选择排序法
  6. Linux:返回上一次目录 / 返回上次命令目录
  7. java_弹球小游戏
  8. Java公开课-01.类和对象
  9. 完美解决某法院HP EVA8400删除VDISK问题
  10. mybaties xml 的头部
  11. React修改state(非redux)中数组和对象里边的某一个属性的值
  12. (3)Python字符串
  13. Nginx教程---03.Nginx日志切割
  14. 软件包管理之rpm与yum
  15. jupyter快捷键
  16. shell特殊变量,记录一下
  17. Type Operators instanceof is used to determine whether a PHP variable is an instantiated object of a certain class/a class that implements an interface
  18. c#7的新特性
  19. Unity项目中的资源管理
  20. iOS:在tableView中通过Masonry使用autolayout在iOS7系统出现约束崩溃

热门文章

  1. LeetCode刷题191125
  2. 表单生成器(Form Builder)之伪造表单数据番外篇——随机车辆牌照
  3. MAC下安装pomelo
  4. web攻击与防御技术-平台搭建与暴力破解
  5. 如何使redis中存放的都是热点数据?
  6. PAT 1013 Battle Over Cities DFS深搜
  7. 使用vue-cli创建工程的时候提示vue-cli Failed to download repo vuejs-templates/webpack-simple:self signed certificate in certificate chain的解决方法
  8. 网站报&quot;组策略阻止了这个程序。要获取详细信息,请与系统管理员联系。&quot;错误。
  9. MySQL学习——管理事务
  10. 池化HttpClient,拿去就能用