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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? iteratecontext.java

?? 本套系統采用了業界當前最為流行的beanAction組件
?? JAVA
字號:
/*
 * 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;
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av资源网站| 亚洲1区2区3区4区| 国产精品一区一区三区| 日韩一区二区视频| 性做久久久久久| 欧美综合一区二区| 一区二区三区四区视频精品免费| www.视频一区| 国产精品美女一区二区三区| 成人一区在线看| 国产精品久久看| 91在线视频播放地址| 亚洲天堂中文字幕| 91福利视频在线| 一区二区三区中文在线观看| 91成人看片片| 亚洲成人免费视| 在线不卡中文字幕| 日本系列欧美系列| 欧美变态tickle挠乳网站| 九九国产精品视频| 久久精品日韩一区二区三区| 成人午夜av影视| 亚洲色图都市小说| 欧美日韩一区不卡| 蜜桃精品视频在线| 久久精品人人做人人综合| www.亚洲免费av| 美女国产一区二区三区| 亚洲免费观看高清完整版在线观看| 欧美人与禽zozo性伦| 福利电影一区二区| 免费看黄色91| 午夜精品福利视频网站| 国产欧美一区二区在线| 欧美一个色资源| 91亚洲午夜精品久久久久久| 日韩欧美自拍偷拍| 亚洲成人免费在线| 色婷婷国产精品久久包臀| 亚洲成av人综合在线观看| 日韩天堂在线观看| 懂色中文一区二区在线播放| 亚洲日本电影在线| 欧美日韩一卡二卡三卡| 精品一区二区免费视频| 国产女人18毛片水真多成人如厕| 91亚洲精品乱码久久久久久蜜桃| 亚洲一级二级在线| 精品免费日韩av| 99国产精品久久久久久久久久久| 亚洲成人动漫在线免费观看| 日韩视频免费观看高清完整版| 国产精品不卡一区二区三区| 欧美日韩在线播| 久久国产生活片100| 国产精品久久久久久久第一福利| 欧美吞精做爰啪啪高潮| 国产一区在线视频| 玉米视频成人免费看| 日韩欧美高清dvd碟片| 不卡av免费在线观看| 首页综合国产亚洲丝袜| 国产偷国产偷亚洲高清人白洁| 日本高清不卡视频| 国产又黄又大久久| 亚洲激情综合网| 2021国产精品久久精品| 91国产成人在线| 国产一区久久久| 亚洲综合丁香婷婷六月香| 亚洲精品一区在线观看| 91国偷自产一区二区三区观看| 久久国产三级精品| 亚洲高清在线精品| 国产欧美日韩中文久久| 欧美日韩另类一区| 99热精品国产| 色呦呦网站一区| 国产精品色噜噜| 91精品国产品国语在线不卡| 成人精品国产福利| 久久精品二区亚洲w码| 亚洲一区二区三区免费视频| 日本一区二区三级电影在线观看 | 六月婷婷色综合| 欧美另类一区二区三区| 日韩精品专区在线| 亚洲欧美综合网| 精品一区二区在线免费观看| gogo大胆日本视频一区| 在线播放日韩导航| 欧美韩国日本不卡| 日韩电影在线观看一区| 岛国一区二区在线观看| 国产精品成人网| 色哟哟在线观看一区二区三区| 激情深爱一区二区| 天堂久久久久va久久久久| 日韩毛片一二三区| 欧美国产禁国产网站cc| 精品欧美一区二区三区精品久久| 欧美日韩亚洲综合在线 | 另类调教123区| 亚欧色一区w666天堂| 亚洲精品日日夜夜| 日韩视频在线观看一区二区| 一本大道久久a久久综合| 粉嫩av亚洲一区二区图片| 精品亚洲aⅴ乱码一区二区三区| 天天色天天爱天天射综合| 亚洲在线免费播放| 亚洲美女屁股眼交3| 国产精品福利一区| 亚洲国产精品成人综合| 久久久精品综合| 精品国产伦一区二区三区观看方式| 欧美美女一区二区三区| 欧美特级限制片免费在线观看| 色一情一乱一乱一91av| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 成人性视频免费网站| 久久成人免费网站| 麻豆国产欧美一区二区三区| 日本亚洲最大的色成网站www| 视频一区二区三区入口| 日日噜噜夜夜狠狠视频欧美人| 亚洲国产wwwccc36天堂| 午夜欧美视频在线观看| 天堂蜜桃一区二区三区| 日本视频在线一区| 久久激情五月激情| 久草这里只有精品视频| 激情五月激情综合网| 国产原创一区二区三区| 国产精品一区二区免费不卡 | 三级一区在线视频先锋| 天堂成人免费av电影一区| 日日摸夜夜添夜夜添亚洲女人| 日本va欧美va精品| 久久精品国产亚洲5555| 国产一区二区三区精品视频| 国产精品一区一区三区| 成人福利视频网站| 97se亚洲国产综合自在线不卡| 欧美一区二区三区在线观看视频| 天堂va蜜桃一区二区三区| 一区二区在线观看av| 久久久久久久久久久99999| av中文字幕不卡| 日本aⅴ亚洲精品中文乱码| 久久综合狠狠综合久久综合88| 福利电影一区二区三区| 亚洲国产精品综合小说图片区| 欧美一级高清片在线观看| 国产成人免费高清| 成人午夜视频在线| 午夜国产精品影院在线观看| 日本aⅴ精品一区二区三区| 亚洲国产日韩综合久久精品| 亚洲高清视频中文字幕| 另类小说色综合网站| 国产资源精品在线观看| 成人三级伦理片| 91久久免费观看| 91精品国产色综合久久| 久久精品在线观看| 亚洲精品第一国产综合野| 免费三级欧美电影| 国产一区二区三区| 色综合天天综合狠狠| 欧美日韩国产bt| 久久免费精品国产久精品久久久久| 日韩一区中文字幕| 日韩av高清在线观看| 国产成人午夜精品影院观看视频| 日本久久电影网| 欧美变态tickling挠脚心| 亚洲欧洲三级电影| 天堂精品中文字幕在线| 成熟亚洲日本毛茸茸凸凹| 欧美在线999| 久久久美女艺术照精彩视频福利播放| 日韩理论片一区二区| 免费在线视频一区| 成人av在线网| 日韩一区二区麻豆国产| **欧美大码日韩| 蜜臀av一区二区在线观看| 99久久国产综合精品女不卡| 日韩三级电影网址| 亚洲欧洲av色图| 久久超碰97人人做人人爱| 日本高清无吗v一区| 久久嫩草精品久久久精品| 亚洲一区二区视频| 国产91精品在线观看| 777欧美精品| 国产精品区一区二区三区| 免费在线观看视频一区|