1 package fit; 2 3 import java.util.*; 4 5 import org.htmlparser.parserHelper.*; 6 import org.htmlparser.tags.*; 7 8 public class Attributes extends ColumnFixture { 9 private AttributeParser attParser = new AttributeParser(); 10 public String key; 11 private Map table; 12 13 public String tagContents; 14 15 public String value() { 16 return (String ) table.get(key); 17 } 18 19 20 public String name() { 21 return (String ) table.get(Tag.TAGNAME); 22 } 23 24 public int attributeCount() { 25 return table.size() - 1; 26 } 27 28 public void execute() throws Exception { 29 table = attParser.parseAttributes(tagContents); 30 } 31 32 public void wrong (Parse cell, String actual) { 33 actual = escape(actual); 34 wrong(cell); 35 cell.addToBody(label("expected") + "<hr>" + actual.replaceAll("\n","<BR>") + label("actual")); 36 } 37 } | Popular Tags |