01: package com.opensymphony.module.sitemesh.html.rules;
02:
03: import com.opensymphony.module.sitemesh.html.BasicRule;
04: import com.opensymphony.module.sitemesh.html.Tag;
05:
06: public class HtmlAttributesRule extends BasicRule {
07:
08: private final PageBuilder page;
09:
10: public HtmlAttributesRule(PageBuilder page) {
11: super ("html");
12: this .page = page;
13: }
14:
15: public void process(Tag tag) {
16: if (tag.getType() == Tag.OPEN) {
17: for (int i = 0; i < tag.getAttributeCount(); i++) {
18: page.addProperty(tag.getAttributeName(i), tag
19: .getAttributeValue(i));
20: }
21: }
22: }
23:
24: }
|