1    代码演练

1.1  代码演练1(未使用装饰者模式)

1.2  代码演练2(使用装饰者模式)

 

 

1    代码演练
1.1  代码演练1(未使用装饰者模式)

需求:

大妈下班卖煎饼,加一个鸡蛋加一元,一个火腿两元,现在a买一个煎饼,b买加蛋的煎饼,c买加肠加蛋的煎饼,请实现它

 

煎饼类:

package com.geely.design.pattern.structural.decorator.v1;

/**
 * 创建煎饼类
 */
public class BatterCake {

    /**
     * 获取加的种类
     * @return
     */
    public String getDescribe(){
        return "煎饼";
    }

    /**
     * 计算所需要的钱
     * @return
     */
    public int cost(){
        return 8;
    }

}

 

煎饼鸡蛋类:

package com.geely.design.pattern.structural.decorator.v1;

/**
 * 加一个鸡蛋的煎饼
 */
public class BatterCakeWithEgg extends BatterCake{
    @Override
    public String getDescribe() {
        return super.getDescribe()+" 加一个鸡蛋";
    }

    @Override
    public int cost() {
        return super.cost()+1;
    }
}

 

 

煎饼鸡蛋香肠类:

package com.geely.design.pattern.structural.decorator.v1;

/**
 * 加一个火腿和一个鸡蛋的煎饼
 */
public class BatterCakeWithEggSausage extends BatterCakeWithEgg{

    @Override
    public String getDescribe() {
        return super.getDescribe() + " 加一个火腿";
    }

    @Override
    public int cost() {
        return super.cost() + 2;
    }
}

 

测试类:

package com.geely.design.pattern.structural.decorator.v1;

public class Test {
    public static void main(String [] args){
        BatterCake batterCake = new BatterCake();
        System.out.println(batterCake.getDescribe()+"销售价格为 "+batterCake.cost());
        BatterCake batterCakeWithEgg = new BatterCakeWithEgg();
        System.out.println(batterCakeWithEgg.getDescribe()+"销售价格为 "+batterCakeWithEgg.cost());
        BatterCake  batterCakeWithEggSausage = new BatterCakeWithEggSausage();
        System.out.println(batterCakeWithEggSausage.getDescribe()+"销售价格为 "+batterCakeWithEggSausage.cost());
    }
}

 

打印结果:

"C:\Program Files\Java\jdk1.7.0_79\bin\java.exe" "-javaagent:D:\java\devolopKit\idea\anZh\IntelliJ IDEA Community Edition 2018.1.4\lib\idea_rt.jar=28469:D:\java\devolopKit\idea\anZh\IntelliJ IDEA Community Edition 2018.1.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.7.0_79\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jce.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jfxrt.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\resources.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\rt.jar;F:\xiangmu3\Xin\Idea\design_pattern\target\classes;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\tomcat\tomcat-servlet-api\7.0.64\tomcat-servlet-api-7.0.64.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-webmvc\4.0.3.RELEASE\spring-webmvc-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-beans\4.0.3.RELEASE\spring-beans-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-context\4.0.3.RELEASE\spring-context-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-aop\4.0.3.RELEASE\spring-aop-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-core\4.0.3.RELEASE\spring-core-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-expression\4.0.3.RELEASE\spring-expression-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-web\4.0.3.RELEASE\spring-web-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-oxm\4.0.3.RELEASE\spring-oxm-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-jdbc\4.0.3.RELEASE\spring-jdbc-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-tx\4.0.3.RELEASE\spring-tx-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-test\4.0.3.RELEASE\spring-test-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\aspectj\aspectjweaver\1.7.3\aspectjweaver-1.7.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\mybatis\mybatis-spring\1.3.0\mybatis-spring-1.3.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\mybatis\mybatis\3.4.1\mybatis-3.4.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\aspectj\aspectjrt\1.6.11\aspectjrt-1.6.11.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\codehaus\jackson\jackson-mapper-asl\1.9.12\jackson-mapper-asl-1.9.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\codehaus\jackson\jackson-core-asl\1.9.12\jackson-core-asl-1.9.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\ch\qos\logback\logback-classic\1.1.2\logback-classic-1.1.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\slf4j\slf4j-api\1.7.6\slf4j-api-1.7.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\ch\qos\logback\logback-core\1.1.2\logback-core-1.1.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\guava\guava\20.0\guava-20.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\junit\junit\4.12\junit-4.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\joda-time\joda-time\2.3\joda-time-2.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\hashids\hashids\1.0.1\hashids-1.0.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-net\commons-net\3.1\commons-net-3.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-fileupload\commons-fileupload\1.2.2\commons-fileupload-1.2.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-io\commons-io\2.0.1\commons-io-2.0.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\pagehelper\pagehelper\4.1.0\pagehelper-4.1.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\miemiedev\mybatis-paginator\1.2.17\mybatis-paginator-1.2.17.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\jsqlparser\jsqlparser\0.9.4\jsqlparser-0.9.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-configuration\commons-configuration\1.10\commons-configuration-1.10.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\zxing\core\2.1\core-2.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\code\gson\gson\2.3.1\gson-2.3.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\redis\clients\jedis\2.6.0\jedis-2.6.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-pool2\2.0\commons-pool2-2.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\projectlombok\lombok\1.16.18\lombok-1.16.18.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\session\spring-session-data-redis\1.2.0.RELEASE\spring-session-data-redis-1.2.0.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-redis\1.7.1.RELEASE\spring-data-redis-1.7.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-keyvalue\1.1.1.RELEASE\spring-data-keyvalue-1.1.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-commons\1.12.1.RELEASE\spring-data-commons-1.12.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-context-support\4.2.5.RELEASE\spring-context-support-4.2.5.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\session\spring-session\1.2.0.RELEASE\spring-session-1.2.0.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\redisson\redisson\2.9.0\redisson-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-common\4.1.8.Final\netty-common-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-codec\4.1.8.Final\netty-codec-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-buffer\4.1.8.Final\netty-buffer-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-transport\4.1.8.Final\netty-transport-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-resolver\4.1.8.Final\netty-resolver-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-handler\4.1.8.Final\netty-handler-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\javax\cache\cache-api\1.0.0\cache-api-1.0.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\projectreactor\reactor-stream\2.0.8.RELEASE\reactor-stream-2.0.8.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\projectreactor\reactor-core\2.0.8.RELEASE\reactor-core-2.0.8.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\reactivestreams\reactive-streams\1.0.0\reactive-streams-1.0.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.6.7\jackson-dataformat-yaml-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\yaml\snakeyaml\1.15\snakeyaml-1.15.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-core\2.6.7\jackson-core-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-databind\2.6.7\jackson-databind-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\dataformat\jackson-dataformat-avro\2.9.0\jackson-dataformat-avro-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\avro\avro\1.8.1\avro-1.8.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\thoughtworks\paranamer\paranamer\2.7\paranamer-2.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\xerial\snappy\snappy-java\1.1.1.3\snappy-java-1.1.1.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\tukaani\xz\1.5\xz-1.5.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\sun\faces\jsf-api\1.2\jsf-api-1.2.jar" com.geely.design.pattern.structural.decorator.v1.Test
煎饼销售价格为 8
煎饼 加一个鸡蛋销售价格为 9
煎饼 加一个鸡蛋 加一个火腿销售价格为 11

Process finished with exit code 0

 

 

 

 

1.2  代码演练2(使用装饰者模式)

需求变更:

现在肠和蛋随机,a  加2蛋2肠 b加1蛋2肠,。。。请用最简单的方式实现它

 

要求:

所谓装饰者模式,要有抽象的实体类和确定的实体类,同时要有抽象的装饰者和确定的装饰者。现在实体类是煎饼,装饰者是鸡蛋和香肠。

 

关联:

煎饼实体类继承煎饼抽象类,装饰者抽象类也继承煎饼抽象类

如何创建煎饼实体类和装饰者抽象类的关系呢?答案是可以通过它们的父类组合来达到目的

 

 

实质:

自我理解,这就像是i=i+1;鸡蛋装饰类也好,香肠装饰类也好,都是把煎饼类new一次,基础上describe加一个描述,价格加一个固定值。

 

UML类图:

 

抽象煎饼类:

package com.geely.design.pattern.structural.decorator.v2;

/**
 * 做成从抽象方法,方便煎饼实体类和装饰类继承
 *
 * 可以做成接口,让其他类实现吗?
 */
public abstract class ABatterCake {
    public abstract String getDescribe();
    public abstract int cost();
}

 

实体煎饼类:

package com.geely.design.pattern.structural.decorator.v2;

public class BatterCake extends ABatterCake{


    @Override
    public String getDescribe() {
        return "一个煎饼";
    }

    @Override
    public int cost() {
        return 8;
    }
}

 

抽象装饰类:

package com.geely.design.pattern.structural.decorator.v2;

/**
 * 装饰者同样继承 抽象煎饼类,这是为了方便 ,和煎饼类交互
 *
 * 如果不用构造器的方式,使用set的方式,是否也能达到目的呢?
 */
public class AbstractDecorator extends ABatterCake {

    /**
     * 定义煎饼属性,方便注入
     */
    private ABatterCake aBatterCake;

    /**
     * 通过构造方法,传入煎饼类
     * @param aBatterCake2
     */
    public AbstractDecorator(ABatterCake aBatterCake2){
        this.aBatterCake = aBatterCake2;
    }

    @Override
    public String getDescribe() {
        return aBatterCake.getDescribe();
    }

    @Override
    public int cost() {
        return aBatterCake.cost();
    }
}

 

鸡蛋装饰类:

package com.geely.design.pattern.structural.decorator.v2;

public class EggDecorator extends AbstractDecorator{

    /**
     * 传入
     * 为什么要实现构造器,父类已经没有无参构造器了
     * @param aBatterCake2
     */
    public EggDecorator(ABatterCake aBatterCake2) {
        super(aBatterCake2);
    }

    @Override
    public String getDescribe() {
        return super.getDescribe() + " 加一个鸡蛋";
    }

    @Override
    public int cost() {
        return super.cost()+1;
    }
}

 

火腿装饰类:

package com.geely.design.pattern.structural.decorator.v2;

public class SauseDecorator extends  AbstractDecorator{
    public SauseDecorator(ABatterCake aBatterCake2) {
        super(aBatterCake2);
    }

    @Override
    public String getDescribe() {
        return super.getDescribe()+" 加一个香肠";
    }

    @Override
    public int cost() {
        return super.cost() + 2;
    }
}

 

测试类:

package com.geely.design.pattern.structural.decorator.v2;

public class Test {
    public static void main(String [] args){
        ABatterCake aBatterCake;
        //给煎饼赋值
        aBatterCake = new BatterCake();
        aBatterCake = new EggDecorator(aBatterCake);
        aBatterCake = new EggDecorator(aBatterCake);
        aBatterCake = new SauseDecorator(aBatterCake);

        System.out.println(aBatterCake.getDescribe()+" 一共卖了"+aBatterCake.cost());
    }
}

 

打印日志:

"C:\Program Files\Java\jdk1.7.0_79\bin\java.exe" "-javaagent:D:\java\devolopKit\idea\anZh\IntelliJ IDEA Community Edition 2018.1.4\lib\idea_rt.jar=29176:D:\java\devolopKit\idea\anZh\IntelliJ IDEA Community Edition 2018.1.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.7.0_79\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jce.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jfxrt.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\resources.jar;C:\Program Files\Java\jdk1.7.0_79\jre\lib\rt.jar;F:\xiangmu3\Xin\Idea\design_pattern\target\classes;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\tomcat\tomcat-servlet-api\7.0.64\tomcat-servlet-api-7.0.64.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-webmvc\4.0.3.RELEASE\spring-webmvc-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-beans\4.0.3.RELEASE\spring-beans-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-context\4.0.3.RELEASE\spring-context-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-aop\4.0.3.RELEASE\spring-aop-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-core\4.0.3.RELEASE\spring-core-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-expression\4.0.3.RELEASE\spring-expression-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-web\4.0.3.RELEASE\spring-web-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-oxm\4.0.3.RELEASE\spring-oxm-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-jdbc\4.0.3.RELEASE\spring-jdbc-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-tx\4.0.3.RELEASE\spring-tx-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-test\4.0.3.RELEASE\spring-test-4.0.3.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\aspectj\aspectjweaver\1.7.3\aspectjweaver-1.7.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\mybatis\mybatis-spring\1.3.0\mybatis-spring-1.3.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\mybatis\mybatis\3.4.1\mybatis-3.4.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\aspectj\aspectjrt\1.6.11\aspectjrt-1.6.11.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\codehaus\jackson\jackson-mapper-asl\1.9.12\jackson-mapper-asl-1.9.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\codehaus\jackson\jackson-core-asl\1.9.12\jackson-core-asl-1.9.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\ch\qos\logback\logback-classic\1.1.2\logback-classic-1.1.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\slf4j\slf4j-api\1.7.6\slf4j-api-1.7.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\ch\qos\logback\logback-core\1.1.2\logback-core-1.1.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\guava\guava\20.0\guava-20.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\junit\junit\4.12\junit-4.12.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\joda-time\joda-time\2.3\joda-time-2.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\hashids\hashids\1.0.1\hashids-1.0.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-net\commons-net\3.1\commons-net-3.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-fileupload\commons-fileupload\1.2.2\commons-fileupload-1.2.2.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-io\commons-io\2.0.1\commons-io-2.0.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\pagehelper\pagehelper\4.1.0\pagehelper-4.1.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\miemiedev\mybatis-paginator\1.2.17\mybatis-paginator-1.2.17.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\github\jsqlparser\jsqlparser\0.9.4\jsqlparser-0.9.4.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-configuration\commons-configuration\1.10\commons-configuration-1.10.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\zxing\core\2.1\core-2.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\google\code\gson\gson\2.3.1\gson-2.3.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\redis\clients\jedis\2.6.0\jedis-2.6.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-pool2\2.0\commons-pool2-2.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\projectlombok\lombok\1.16.18\lombok-1.16.18.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\session\spring-session-data-redis\1.2.0.RELEASE\spring-session-data-redis-1.2.0.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-redis\1.7.1.RELEASE\spring-data-redis-1.7.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-keyvalue\1.1.1.RELEASE\spring-data-keyvalue-1.1.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\data\spring-data-commons\1.12.1.RELEASE\spring-data-commons-1.12.1.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\spring-context-support\4.2.5.RELEASE\spring-context-support-4.2.5.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\springframework\session\spring-session\1.2.0.RELEASE\spring-session-1.2.0.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\redisson\redisson\2.9.0\redisson-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-common\4.1.8.Final\netty-common-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-codec\4.1.8.Final\netty-codec-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-buffer\4.1.8.Final\netty-buffer-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-transport\4.1.8.Final\netty-transport-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-resolver\4.1.8.Final\netty-resolver-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\netty\netty-handler\4.1.8.Final\netty-handler-4.1.8.Final.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\javax\cache\cache-api\1.0.0\cache-api-1.0.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\projectreactor\reactor-stream\2.0.8.RELEASE\reactor-stream-2.0.8.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\io\projectreactor\reactor-core\2.0.8.RELEASE\reactor-core-2.0.8.RELEASE.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\reactivestreams\reactive-streams\1.0.0\reactive-streams-1.0.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.6.7\jackson-dataformat-yaml-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\yaml\snakeyaml\1.15\snakeyaml-1.15.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-core\2.6.7\jackson-core-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-databind\2.6.7\jackson-databind-2.6.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\dataformat\jackson-dataformat-avro\2.9.0\jackson-dataformat-avro-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\avro\avro\1.8.1\avro-1.8.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\thoughtworks\paranamer\paranamer\2.7\paranamer-2.7.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\xerial\snappy\snappy-java\1.1.1.3\snappy-java-1.1.1.3.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\org\tukaani\xz\1.5\xz-1.5.jar;F:\xiangmu3\Xin\Idea\design_Maven_Home\lib\com\sun\faces\jsf-api\1.2\jsf-api-1.2.jar" com.geely.design.pattern.structural.decorator.v2.Test
一个煎饼 加一个鸡蛋 加一个鸡蛋 加一个香肠 一共卖了12

Process finished with exit code 0

 

posted on 2019-09-08 15:54  菜鸟乙  阅读(158)  评论(0编辑  收藏  举报