KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fit > Attributes


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 JavaDoc key;
11     private Map table;
12
13     public String JavaDoc tagContents;
14
15     public String JavaDoc value() {
16         return (String JavaDoc) table.get(key);
17     }
18
19
20     public String JavaDoc name() {
21         return (String JavaDoc) table.get(Tag.TAGNAME);
22     }
23
24     public int attributeCount() {
25         return table.size() - 1;
26     }
27
28     public void execute() throws Exception JavaDoc {
29         table = attParser.parseAttributes(tagContents);
30     }
31
32     public void wrong (Parse cell, String JavaDoc actual) {
33         actual = escape(actual);
34         wrong(cell);
35         cell.addToBody(label("expected") + "<hr>" + actual.replaceAll("\n","<BR>") + label("actual"));
36     }
37 }
Popular Tags