亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Spring案例打印機(jī)的實(shí)現(xiàn)過(guò)程詳解

 更新時(shí)間:2019年10月24日 14:20:32   作者:關(guān)耳er  
這篇文章主要介紹了Spring案例打印機(jī)的實(shí)現(xiàn)過(guò)程詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下

這篇文章主要介紹了Spring案例打印機(jī)的實(shí)現(xiàn)過(guò)程詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下

目錄:

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相當(dāng)于當(dāng)前bean唯一標(biāo)識(shí)
    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>
  <!--打印機(jī)-->
  <bean id="printer" class="cn.spring.print.printer.Printer">
    <!--將墨盒紙張組合起來(lái)-->
    <property name="paper" ref="b5Paper"></property>
    <property name="ink" ref="colorInk"></property>
  </bean>
</beans>

2.墨盒接口Ink

  

3.黑白墨盒實(shí)現(xiàn)類(lèi)BlackWhiteInk

  

4.彩色墨盒實(shí)現(xiàn)類(lèi)ColorInk

  

5.紙張接口Paper

  

6. A4紙張實(shí)現(xiàn)類(lèi) A4Paper

  

7. B5紙張實(shí)現(xiàn)類(lèi)B5Paper

  

8. 打印機(jī)類(lèi) Printer

  

9. 測(cè)試類(lèi)PrintTest

  

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論