<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    用command-chain完成的For循環(huán)

    package nl.enovation.commons.command;

    import java.util.Collection;

    import org.apache.commons.chain.Command;
    import org.apache.commons.chain.Context;

    public class ForeachCommand implements Command {
        private String collectionProperty;
        private String instanceProperty;
        private Command command;
       
        @SuppressWarnings("unchecked")
        public boolean execute(Context context) throws Exception {
            Collection<? extends Object> collection = (Collection<? extends Object>) context.get(collectionProperty);
            if (collection != null) {
                for(Object object : collection) {
                    context.put(instanceProperty, object);
                    if (PROCESSING_COMPLETE == command.execute(context)) {
                        return PROCESSING_COMPLETE;
                    } // else continue
                }
            }
            return CONTINUE_PROCESSING;
        }

        public String getCollectionProperty() {
            return collectionProperty;
        }

        public void setCollectionProperty(String collectionProperty) {
            this.collectionProperty = collectionProperty;
        }

        public String getInstanceProperty() {
            return instanceProperty;
        }

        public void setInstanceProperty(String instanceProperty) {
            this.instanceProperty = instanceProperty;
        }

        public Command getCommand() {
            return command;
        }

        public void setCommand(Command command) {
            this.command = command;
        }

    }

    posted on 2008-01-22 10:24 劉錚 閱讀(362) 評論(0)  編輯  收藏 所屬分類: JAVA General

    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    導(dǎo)航

    統(tǒng)計(jì)

    留言簿(1)

    文章分類(141)

    文章檔案(147)

    搜索

    最新評論

    主站蜘蛛池模板: 亚洲an日韩专区在线| 九一在线完整视频免费观看| 国产精品国产自线拍免费软件| 麻豆91免费视频| 亚洲av无码一区二区乱子伦as| 999在线视频精品免费播放观看| 亚洲AV日韩AV永久无码色欲| 国产成人麻豆亚洲综合无码精品| 亚洲黄色免费电影| 免费无码一区二区| 亚洲第一永久在线观看| 亚洲精品人成无码中文毛片 | 欧洲乱码伦视频免费国产| 亚洲va无码专区国产乱码| 色吊丝永久在线观看最新免费| 99久久免费国产精精品| 亚洲国产综合AV在线观看| 亚洲爱情岛论坛永久| 夜色阁亚洲一区二区三区| 四虎永久在线观看免费网站网址| 一级毛片免费播放试看60分钟| wwwxxx亚洲| 亚洲国产精品国自产拍电影| 亚洲日韩国产一区二区三区| 成年人网站在线免费观看| 午夜无码A级毛片免费视频 | 在线视频免费观看爽爽爽| 久久免费99精品国产自在现线| 日韩亚洲产在线观看| 亚洲视频在线观看网站| 亚洲人成无码网站| 国产成人一区二区三区免费视频| 亚洲人成免费网站| 成人免费区一区二区三区 | 在线观看国产一区亚洲bd| 亚洲男女性高爱潮网站| 亚洲综合在线另类色区奇米| 免费在线观看黄网| 在线播放免费播放av片| 日本精品人妻无码免费大全| 亚洲w码欧洲s码免费|