1 18 19 package org.apache.strutsel.taglib.logic; 20 21 import org.apache.struts.taglib.logic.IterateTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 40 public class ELIterateTag extends IterateTag { 41 42 46 private String collectionExpr; 47 51 private String idExpr; 52 56 private String indexIdExpr; 57 61 private String lengthExpr; 62 66 private String nameExpr; 67 71 private String offsetExpr; 72 76 private String propertyExpr; 77 81 private String scopeExpr; 82 86 private String typeExpr; 87 88 92 public String getCollectionExpr() { return (collectionExpr); } 93 97 public String getIdExpr() { return (idExpr); } 98 102 public String getIndexIdExpr() { return (indexIdExpr); } 103 107 public String getLengthExpr() { return (lengthExpr); } 108 112 public String getNameExpr() { return (nameExpr); } 113 117 public String getOffsetExpr() { return (offsetExpr); } 118 122 public String getPropertyExpr() { return (propertyExpr); } 123 127 public String getScopeExpr() { return (scopeExpr); } 128 132 public String getTypeExpr() { return (typeExpr); } 133 134 138 public void setCollectionExpr(String collectionExpr) { this.collectionExpr = collectionExpr; } 139 143 public void setIdExpr(String idExpr) { this.idExpr = idExpr; } 144 148 public void setIndexIdExpr(String indexIdExpr) { this.indexIdExpr = indexIdExpr; } 149 153 public void setLengthExpr(String lengthExpr) { this.lengthExpr = lengthExpr; } 154 158 public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; } 159 163 public void setOffsetExpr(String offsetExpr) { this.offsetExpr = offsetExpr; } 164 168 public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; } 169 173 public void setScopeExpr(String scopeExpr) { this.scopeExpr = scopeExpr; } 174 178 public void setTypeExpr(String typeExpr) { this.typeExpr = typeExpr; } 179 180 183 public void release() 184 { 185 super.release(); 186 setCollectionExpr(null); 187 setIdExpr(null); 188 setIndexIdExpr(null); 189 setLengthExpr(null); 190 setNameExpr(null); 191 setOffsetExpr(null); 192 setPropertyExpr(null); 193 setScopeExpr(null); 194 setTypeExpr(null); 195 } 196 197 202 public int doStartTag() throws JspException { 203 evaluateExpressions(); 204 return(super.doStartTag()); 205 } 206 207 213 private void evaluateExpressions() throws JspException { 214 String string = null; 215 Object object = null; 216 217 if ((object = EvalHelper.eval("collection", getCollectionExpr(), 218 this, pageContext)) != null) 219 setCollection(object); 220 221 if ((string = EvalHelper.evalString("id", getIdExpr(), 222 this, pageContext)) != null) 223 setId(string); 224 225 if ((string = EvalHelper.evalString("indexId", getIndexIdExpr(), 226 this, pageContext)) != null) 227 setIndexId(string); 228 229 if ((string = EvalHelper.evalString("length", getLengthExpr(), 230 this, pageContext)) != null) 231 setLength(string); 232 233 if ((string = EvalHelper.evalString("name", getNameExpr(), 234 this, pageContext)) != null) 235 setName(string); 236 237 if ((string = EvalHelper.evalString("offset", getOffsetExpr(), 238 this, pageContext)) != null) 239 setOffset(string); 240 241 if ((string = EvalHelper.evalString("property", getPropertyExpr(), 242 this, pageContext)) != null) 243 setProperty(string); 244 245 if ((string = EvalHelper.evalString("scope", getScopeExpr(), 246 this, pageContext)) != null) 247 setScope(string); 248 249 if ((string = EvalHelper.evalString("type", getTypeExpr(), 250 this, pageContext)) != null) 251 setType(string); 252 } 253 } 254 | Popular Tags |