KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > module > sitemesh > parser > rules > HtmlAttributesRule


1 package com.opensymphony.module.sitemesh.parser.rules;
2
3 import com.opensymphony.module.sitemesh.HTMLPage;
4 import com.opensymphony.module.sitemesh.html.BasicRule;
5 import com.opensymphony.module.sitemesh.html.Tag;
6
7 public class HtmlAttributesRule extends BasicRule{
8
9     private final HTMLPage page;
10
11     public HtmlAttributesRule(HTMLPage page) {
12         super("html");
13         this.page = page;
14     }
15
16     public void process(Tag tag) {
17         if (tag.getType() == Tag.OPEN) {
18             for (int i = 0; i < tag.getAttributeCount(); i++) {
19                 page.addProperty(tag.getAttributeName(i), tag.getAttributeValue(i));
20             }
21         }
22     }
23
24 }
25
Popular Tags