1 15 package org.apache.tapestry.script; 16 17 import org.apache.tapestry.util.xml.RuleDirectedParser; 18 import org.xml.sax.Attributes ; 19 20 28 class IfRule extends AbstractTokenRule 29 { 30 private boolean _condition; 31 32 public IfRule(boolean condition) 33 { 34 _condition = condition; 35 } 36 37 public void endElement(RuleDirectedParser parser) 38 { 39 parser.pop(); 40 } 41 42 public void startElement(RuleDirectedParser parser, Attributes attributes) 43 { 44 String expression = getAttribute(attributes, "expression"); 45 46 if (expression == null) 47 expression = getAttribute(attributes, "property-path"); 49 IScriptToken token = new IfToken(_condition, expression, parser.getLocation()); 50 51 addToParent(parser, token); 52 53 parser.push(token); 54 } 55 56 } 57 | Popular Tags |