1 15 package org.apache.tapestry.script; 16 17 import org.apache.tapestry.Tapestry; 18 import org.apache.tapestry.util.xml.RuleDirectedParser; 19 import org.xml.sax.Attributes ; 20 21 28 class LetRule extends AbstractTokenRule 29 { 30 31 public void startElement(RuleDirectedParser parser, Attributes attributes) 32 { 33 String key = getAttribute(attributes, "key"); 34 35 String unique = getAttribute(attributes, "unique"); 36 boolean uniqueFlag = unique != null && unique.equals("yes"); 37 38 parser.validate(key, Tapestry.SIMPLE_PROPERTY_NAME_PATTERN, "ScriptParser.invalid-key"); 39 40 LetToken token = new LetToken(key, uniqueFlag, parser.getLocation()); 41 42 addToParent(parser, token); 43 44 parser.push(token); 45 } 46 47 public void endElement(RuleDirectedParser parser) 48 { 49 parser.pop(); 50 } 51 52 } 53 | Popular Tags |