1 18 19 package org.apache.strutsel.taglib.html; 20 21 import org.apache.struts.taglib.html.OptionsCollectionTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 45 public class ELOptionsCollectionTag extends OptionsCollectionTag { 46 47 51 private String filterExpr; 52 56 private String labelExpr; 57 61 private String nameExpr; 62 66 private String propertyExpr; 67 71 private String styleExpr; 72 76 private String styleClassExpr; 77 81 private String valueExpr; 82 83 87 public String getFilterExpr() { return (filterExpr); } 88 92 public String getLabelExpr() { return (labelExpr); } 93 97 public String getNameExpr() { return (nameExpr); } 98 102 public String getPropertyExpr() { return (propertyExpr); } 103 107 public String getStyleExpr() { return (styleExpr); } 108 112 public String getStyleClassExpr() { return (styleClassExpr); } 113 117 public String getValueExpr() { return (valueExpr); } 118 119 123 public void setFilterExpr(String filterExpr) { this.filterExpr = filterExpr; } 124 128 public void setLabelExpr(String labelExpr) { this.labelExpr = labelExpr; } 129 133 public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; } 134 138 public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; } 139 143 public void setStyleExpr(String styleExpr) { this.styleExpr = styleExpr; } 144 148 public void setStyleClassExpr(String styleClassExpr) { this.styleClassExpr = styleClassExpr; } 149 153 public void setValueExpr(String valueExpr) { this.valueExpr = valueExpr; } 154 155 158 public void release() 159 { 160 super.release(); 161 setFilterExpr(null); 162 setLabelExpr(null); 163 setNameExpr(null); 164 setPropertyExpr(null); 165 setStyleExpr(null); 166 setStyleClassExpr(null); 167 setValueExpr(null); 168 } 169 170 175 public int doStartTag() throws JspException { 176 evaluateExpressions(); 177 return (super.doStartTag()); 178 } 179 180 186 private void evaluateExpressions() throws JspException { 187 String string = null; 188 Boolean bool = null; 189 190 if ((bool = EvalHelper.evalBoolean("filter", getFilterExpr(), 191 this, pageContext)) != null) 192 setFilter(bool.booleanValue()); 193 194 if ((string = EvalHelper.evalString("label", getLabelExpr(), 195 this, pageContext)) != null) 196 setLabel(string); 197 198 if ((string = EvalHelper.evalString("name", getNameExpr(), 199 this, pageContext)) != null) 200 setName(string); 201 202 if ((string = EvalHelper.evalString("property", getPropertyExpr(), 203 this, pageContext)) != null) 204 setProperty(string); 205 206 if ((string = EvalHelper.evalString("style", getStyleExpr(), 207 this, pageContext)) != null) 208 setStyle(string); 209 210 if ((string = EvalHelper.evalString("styleClass", getStyleClassExpr(), 211 this, pageContext)) != null) 212 setStyleClass(string); 213 214 221 if ((string = EvalHelper.evalString("value", getValueExpr(), 222 this, pageContext)) != null) 223 setValue(string); 224 } 225 } 226 | Popular Tags |