1 14 package org.wings.template; 15 16 import org.wings.template.parser.ParseContext; 17 import org.wings.template.parser.PositionReader; 18 import org.wings.template.parser.SGMLTag; 19 20 import java.io.IOException ; 21 22 28 public class SimpleTagHandler extends TemplateTagHandler { 29 37 public SGMLTag parseTag(ParseContext context, 38 PositionReader input, 39 long startPosition, 40 SGMLTag tag) 41 throws IOException { 42 48 tag.parse(input); 49 50 56 startPos = startPosition + tag.getOffset(); 57 58 61 name = tag.value("NAME", null); 62 if (name == null) 63 return null; 64 65 69 String type = tag.value("TYPE", null); 70 if (type != null && "RADIO".equals(type.toUpperCase())) { 71 String value = tag.value("VALUE", null); 72 if (value != null) 73 name = name + "=" + value; 74 } 75 76 endPos = input.getPosition(); 77 78 properties = tag.getAttributes(); 79 properties.remove("NAME"); 80 properties.remove("TYPE"); 81 properties.remove("VALUE"); 82 83 return tag; 84 } 85 } 86 87 88 | Popular Tags |