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

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

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

    用command-chain完成的For循環

    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

    導航

    統計

    留言簿(1)

    文章分類(141)

    文章檔案(147)

    搜索

    最新評論

    主站蜘蛛池模板: 中文字幕免费在线看电影大全| 边摸边脱吃奶边高潮视频免费| 午夜视频在线免费观看| 在线亚洲精品自拍| 国产裸体美女永久免费无遮挡| 免费乱码中文字幕网站| 免费精品视频在线| 国产亚洲美日韩AV中文字幕无码成人 | 亚洲伊人色一综合网| 最近2019中文字幕免费大全5| 久久久亚洲AV波多野结衣| 99久久免费国产香蕉麻豆| 在线亚洲高清揄拍自拍一品区| 午夜dj在线观看免费视频| 国产AV日韩A∨亚洲AV电影| 亚洲午夜久久久久久久久久| 黄色免费在线网站| 亚洲国产中文在线视频| 在线观看成人免费视频| 一级A毛片免费观看久久精品| 亚洲无人区午夜福利码高清完整版| 久久久久久免费一区二区三区| 亚洲精品亚洲人成在线麻豆| 成人a免费α片在线视频网站| 一级成人a做片免费| 亚洲三级电影网址| 免费无码黄动漫在线观看| 亚洲精品黄色视频在线观看免费资源| 亚洲国产精品无码久久久秋霞2| 2019中文字幕在线电影免费| 中文日韩亚洲欧美制服| 中文字幕亚洲不卡在线亚瑟| 免费观看激色视频网站bd| 色天使色婷婷在线影院亚洲| 亚洲AV第一页国产精品| 成人毛片免费网站| 中文字幕免费在线观看动作大片| 亚洲免费视频观看| 久久亚洲精品无码播放| 久久久久久国产精品免费免费| 九九免费精品视频在这里|