⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 querysegment.java

📁 webwork source
💻 JAVA
字号:
/* * WebWork, Web Application Framework * * Distributable under Apache license. * See terms of license at opensource.org */package webwork.util;import java.util.ArrayList;import java.util.List;/** *	A segment of a ValueStack Query. *       * @author Maurice C. Parker (maurice@vineyardenterprise.com) *	@version $Revision: 1.10 $ */public class QuerySegment{   // Attributes ----------------------------------------------------   public final static int STRING = 0;   public final static int TRUE = 1;   public final static int FALSE = 2;   public final static int CURRENT = 3;   public final static int PARENT = 4;   public final static int ROOT = 5;   public final static int ATTRIBUTE = 6;   public final static int PARAMETER = 7;   public final static int PROPERTY = 8;   public final static int COLLECTION = 9;   public final static int METHOD = 10;   public final static int EXPAND = 11;   public final static int NUMBER = 12;   public final static int NULL = 13;   private Query query;   private String id;   private int type;   private List values;	// Public --------------------------------------------------------   public QuerySegment(int type)   {      this.type = type;   }   public QuerySegment(String id, int type)   {      this.id = id;      this.type = type;   }      public QuerySegment(String id, Query query, int type)   {      this.id = id;      this.query = query;      this.type = type;   }   /**    * Add a value that is associated with this QuerySegment.    */   public void addValue(Object value)   {      if ( values == null )         values = new ArrayList();      values.add(value);   }      public void createValues()   {   	values = new ArrayList();   }   /**    * Return the identification string.    */   public String getId()   {      return id;   }   public Query getQuery()   {      return query;   }	   /**    * Return this QuerySegments type.  The type is used to identify    * if this QuerySegment will be used to access an object property,    * an object method, or a Collection.    */   public int getType()   {      return type;   }   /**    * Returns a list of values for this QuerySegment.    */   public List getValues()   {      return values;   }   public String toString() {      StringBuffer sb = new StringBuffer();      sb.append("\"");      if (values!=null) {         for(int i=0; i<values.size(); i++) {            sb.append(values.get(i));            if ((i + 1) < values.size()) {               sb.append(",");            }         }      }      sb.append("\"");      return "[id=\"" + id + "\" type=\"" + type + "\" values=" + sb.toString() + "]";   }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -