亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? iteratecontext.java

?? 本套系統(tǒng)采用了業(yè)界當(dāng)前最為流行的beanAction組件
?? JAVA
字號(hào):
/*
 * Created on Apr 17, 2005
 *
 */
package com.ibatis.sqlmap.engine.mapping.sql.dynamic.elements;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.ibatis.sqlmap.client.SqlMapException;

/**
 * @author Brandon Goodin
 */
public class IterateContext implements Iterator {
  
  private static final String PROCESS_INDEX = "ProcessIndex";
  private static final String PROCESS_STRING = "ProcessString";
  
  private Iterator iterator;
  private int index = -1;

  private String property;
  private boolean allowNext = true;

  private boolean isFinal = false;
  private SqlTag tag;
  
  private IterateContext parent;
  
  /**
   * This variable is true if some of the sub elements have
   * actually produced content.  This is used to test
   * whether to add the open and conjunction text to the
   * generated statement.
   * 
   * This variable is used to replace the deprecated and dangerous
   * isFirst method.
   */
  private boolean someSubElementsHaveContent;
  
  /**
   * This variable is set by the doEndFragment method in IterateTagHandler
   * to specify that the first content producing sub element has happened.
   * The doPrepend method will test the value to know whether or not
   * to process the prepend.
   * 
   * This variable is used to replace the deprecated and dangerous
   * isFirst method.
   */
  private boolean isPrependEnabled;
  
  public IterateContext(Object collection,SqlTag tag, IterateContext parent) {
    this.parent = parent;
    this.tag = tag;
    if (collection instanceof Collection) {
      this.iterator = ((Collection) collection).iterator();
    } else if (collection instanceof Iterator) {
      this.iterator = ((Iterator) collection);
    } else if (collection.getClass().isArray()) {
      List list = arrayToList(collection);
      this.iterator = list.iterator();
    } else {
      throw new SqlMapException("ParameterObject or property was not a Collection, Array or Iterator.");
    }
  }

  public boolean hasNext() {
    return iterator != null && iterator.hasNext();
  }

  public Object next() {
    index++;
    return iterator.next();
  }

  public void remove() {
    iterator.remove();
  }

  public int getIndex() {
    return index;
  }

  /**
   * 
   * @return
   * @deprecated This method should not be used to decide whether or not to
   * add prepend and open text to the generated statement.  Rather, use the
   * methods isPrependEnabled() and someSubElementsHaveContent().
   */
  public boolean isFirst() {
    return index == 0;
  }

  public boolean isLast() {
    return iterator != null && !iterator.hasNext();
  }
  
  private List arrayToList(Object array) {
    List list = null;
    if (array instanceof Object[]) {
      list = Arrays.asList((Object[]) array);
    } else {
      list = new ArrayList();
      for (int i = 0, n = Array.getLength(array); i < n; i++) {
        list.add(Array.get(array, i));
      }
    }
    return list;
  }

  /**
   * @return Returns the property.
   */
  public String getProperty() {
    return property;
  }
  
  /**
   * This property specifies whether to increment the iterate in
   * the doEndFragment. The ConditionalTagHandler has the ability
   * to increment the IterateContext, so it is neccessary to avoid
   * incrementing in both the ConditionalTag and the IterateTag.
   *
   * @param property The property to set.
   */
  public void setProperty(String property) {
    this.property = property;
  }
  
  /**
   * @return Returns the allowNext.
   */
  public boolean isAllowNext() {
    return allowNext;
  }
  
  /**
   * @param performIterate The allowNext to set.
   */
  public void setAllowNext(boolean performIterate) {
    this.allowNext = performIterate;
  }
  /**
   * @return Returns the tag.
   */
  public SqlTag getTag() {
    return tag;
  }
  /**
   * @param tag The tag to set.
   */
  public void setTag(SqlTag tag) {
    this.tag = tag;
  }

  /**
   *
   * @return
   */
  public boolean isFinal() {
    return isFinal;
  }

  /**
   * This attribute is used to mark whether an iterate tag is
   * in it's final iteration. Since the ConditionalTagHandler
   * can increment the iterate the final iterate in the doEndFragment
   * of the IterateTagHandler needs to know it is in it's final iterate.
   *
   * @param aFinal
   */
  public void setFinal(boolean aFinal) {
    isFinal = aFinal;
  }
  
  
  /**
   * Returns the last property of any bean specified in this IterateContext.
   * @return The last property of any bean specified in this IterateContext.
   */
  public String getEndProperty() {
      if (parent != null) {
          int parentPropertyIndex = property.indexOf(parent.getProperty());
          if (parentPropertyIndex > -1) {
              int endPropertyIndex1 = property.indexOf(']', parentPropertyIndex);
              int endPropertyIndex2 = property.indexOf('.', parentPropertyIndex);
              return property.substring(parentPropertyIndex + Math.max(endPropertyIndex1, endPropertyIndex2) + 1, property.length());
          }
          else {
              return property;
          }
      }
      else {
          return property;
      }
  }
  
  /**
   * Replaces value of a tag property to match it's value with current iteration and all other iterations.
   * @param tagProperty the property of a TagHandler.
   * @return A Map containing the modified tag property in PROCESS_STRING key and the index where the modification occured in PROCESS_INDEX key.
   */
  protected Map processTagProperty(String tagProperty) {
      if (parent != null) {
          Map parentResult = parent.processTagProperty(tagProperty);
          return this.addIndex((String) parentResult.get(PROCESS_STRING), ((Integer) parentResult.get(PROCESS_INDEX)).intValue());
      }
      else {
          return this.addIndex(tagProperty, 0);
      }
  }
  
  /**
   * Replaces value of a tag property to match it's value with current iteration and all other iterations.
   * @param tagProperty the property of a TagHandler.
   * @return The tag property with all "[]" replaced with the correct iteration value.
   */
  public String addIndexToTagProperty(String tagProperty) {
      Map map = this.processTagProperty(tagProperty);
      return (String) map.get(PROCESS_STRING);
  }
  
  /**
   * Adds index value to the first found property matching this Iteration starting at index startIndex.
   * @param input The input String.
   * @param startIndex The index where search for property begins.
   * @return A Map containing the modified tag property in PROCESS_STRING key and the index where the modification occured in PROCESS_INDEX key.
   */
  protected Map addIndex(String input, int startIndex) {
      String endProperty = getEndProperty() + "[";
      int propertyIndex = input.indexOf(endProperty, startIndex);
      int modificationIndex = 0;
      // Is the iterate property in the tag property at all?
      if (propertyIndex > -1) {
          // Make sure the tag property does not already have a number.
          if (input.charAt(propertyIndex + endProperty.length()) == ']') {
              // Add iteration number to property.
              input = input.substring(0, propertyIndex + endProperty.length()) + this.getIndex() + input.substring(propertyIndex + endProperty.length());
              modificationIndex = propertyIndex + endProperty.length();
          }
      }
      Map ret = new HashMap();
      ret.put(PROCESS_INDEX, new Integer(modificationIndex));
      ret.put(PROCESS_STRING, input);
      return ret;
  }
  
  
  public IterateContext getParent() {
    return parent;
  }

  public void setParent(IterateContext parent) {
    this.parent = parent;
  }

  public boolean someSubElementsHaveContent() {
    return someSubElementsHaveContent;
  }

  public void setSomeSubElementsHaveContent(boolean someSubElementsHaveContent) {
    this.someSubElementsHaveContent = someSubElementsHaveContent;
  }

  public boolean isPrependEnabled() {
    return isPrependEnabled;
  }

  public void setPrependEnabled(boolean isPrependEnabled) {
    this.isPrependEnabled = isPrependEnabled;
  }
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品视频在线观看视频| 国产精品久久久久影院| 成人18视频日本| 国产自产v一区二区三区c| 免费在线观看一区二区三区| 亚洲欧洲成人自拍| 欧美国产视频在线| 国产亚洲欧美日韩日本| 日韩久久久精品| 久久婷婷综合激情| 欧美激情一区二区| 国产日产欧美一区二区三区 | 欧美电影一区二区| 欧美老年两性高潮| 欧美成人精品1314www| 久久综合色一综合色88| 亚洲国产精品t66y| 亚洲一区二区精品久久av| 亚洲777理论| 黄色成人免费在线| www.色精品| 欧美日本韩国一区二区三区视频| 91精品国产入口| 国产精品无遮挡| 亚洲一区二区av电影| 国模无码大尺度一区二区三区 | 国产精品久久精品日日| 亚洲蜜臀av乱码久久精品| 午夜久久电影网| 国产成人小视频| 精品视频一区三区九区| 精品91自产拍在线观看一区| 日韩伦理电影网| 另类小说一区二区三区| 95精品视频在线| 日韩欧美另类在线| 成人免费视频在线观看| 六月丁香婷婷久久| 色呦呦日韩精品| 日韩午夜小视频| 亚洲欧美日韩一区二区| 精品一区二区三区影院在线午夜 | 一卡二卡三卡日韩欧美| 国产一区二区精品久久91| 欧美色精品在线视频| 欧美国产禁国产网站cc| 久久国产剧场电影| 在线视频欧美精品| 国产精品每日更新在线播放网址 | 日韩美女天天操| 亚洲女人的天堂| 成年人午夜久久久| 2017欧美狠狠色| 久久草av在线| 69av一区二区三区| 亚洲国产精品一区二区www | 欧美伊人久久久久久久久影院| 久久久久久久久久久久久女国产乱 | 777午夜精品免费视频| 亚洲女爱视频在线| 99re8在线精品视频免费播放| 精品国产乱码久久久久久闺蜜| 亚洲v精品v日韩v欧美v专区| 91啪九色porn原创视频在线观看| 国产午夜精品福利| 国产精品自拍毛片| 国产日产欧美一区| 爽好久久久欧美精品| 欧美午夜精品一区| 亚洲专区一二三| 在线观看亚洲专区| 亚洲第一主播视频| 欧美日韩免费电影| 日韩专区在线视频| 日韩午夜av电影| 日韩精品国产精品| 欧美日韩综合色| 亚洲v日本v欧美v久久精品| 欧美精品一二三| 美女视频黄 久久| 久久一区二区三区四区| 国产精品一卡二| 国产精品久线在线观看| 色噜噜夜夜夜综合网| 亚洲精品五月天| 91国偷自产一区二区开放时间| 国产精品视频一二| 在线观看欧美黄色| 青青青爽久久午夜综合久久午夜 | 成人性生交大片免费看中文| 欧美激情中文不卡| 91福利在线观看| 亚洲高清不卡在线| 欧美日韩高清一区二区三区| 奇米影视一区二区三区| 国产亚洲人成网站| 一本到三区不卡视频| 日本女人一区二区三区| 欧美高清在线一区| 欧美私人免费视频| 国产真实乱对白精彩久久| 国产精品视频一二三| 91国偷自产一区二区使用方法| 无吗不卡中文字幕| 欧美激情一区二区三区四区 | 日韩高清在线电影| 国产婷婷色一区二区三区| 91久久精品日日躁夜夜躁欧美| 日韩高清一区在线| 国产精品久久久久久久久免费桃花| 97久久精品人人爽人人爽蜜臀| 亚洲午夜视频在线观看| 久久只精品国产| 久久精品免视看| 国模一区二区三区白浆| 秋霞电影一区二区| 国产人成亚洲第一网站在线播放 | 91社区在线播放| 亚洲一区二区在线观看视频 | 亚洲一二三专区| 国产亚洲人成网站| 在线播放91灌醉迷j高跟美女| www.99精品| 国产精品一区二区在线观看网站| 亚洲综合在线五月| 日韩欧美国产一区二区三区 | 欧美一区二视频| 99久久免费精品| 国产精品99久久久久久似苏梦涵| 亚洲一区二区四区蜜桃| 日韩三级精品电影久久久| 91免费视频大全| 成人免费毛片aaaaa**| 精品一区二区免费看| 日本不卡视频一二三区| 午夜欧美大尺度福利影院在线看| 国产精品二三区| 中文字幕+乱码+中文字幕一区| 欧美r级在线观看| 欧美日本一区二区三区四区| 日本精品一级二级| 国产精品99久久久| 亚洲成人动漫av| 一区二区三区在线影院| 国产欧美久久久精品影院| 精品久久久久久久久久久院品网| 欧美日韩综合在线| 欧美中文字幕一区| 99re免费视频精品全部| 成人97人人超碰人人99| 国产宾馆实践打屁股91| 精品一二三四区| 国产原创一区二区三区| 蜜桃传媒麻豆第一区在线观看| 日韩高清电影一区| 午夜精品久久久久久久久久| 亚洲国产日产av| 亚洲一区二区三区四区不卡| 一区二区三区四区国产精品| 一二三四社区欧美黄| 亚洲国产日日夜夜| 日韩黄色免费电影| 青青草成人在线观看| 蜜臀精品一区二区三区在线观看| 美国精品在线观看| 国产一区免费电影| av网站一区二区三区| 欧洲中文字幕精品| www.色综合.com| 国产麻豆一精品一av一免费 | 亚洲综合色噜噜狠狠| 亚洲成人av中文| 精品亚洲porn| 成人性生交大片免费看中文网站| 99re亚洲国产精品| 在线观看日产精品| 91精品国产91久久久久久最新毛片| 精品日韩一区二区三区| 亚洲国产成人在线| 樱桃国产成人精品视频| 亚洲一区二区美女| 国产一区二区视频在线播放| 国产一区二区三区久久久| 99国产麻豆精品| 日韩欧美一区二区视频| 国产精品国产三级国产aⅴ原创| 夜夜嗨av一区二区三区| 麻豆成人久久精品二区三区小说| 成人深夜在线观看| 色欲综合视频天天天| 精品国产凹凸成av人网站| 专区另类欧美日韩| 秋霞电影网一区二区| 午夜精品久久久久久久久| 国产一区二区免费看| 欧美日韩亚洲综合| 久久精品亚洲国产奇米99| 亚洲午夜久久久| 丁香五精品蜜臀久久久久99网站| 欧美日韩中字一区|