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 MetaTagRule extends BasicRule {
07:
08: private final PageBuilder page;
09:
10: public MetaTagRule(PageBuilder page) {
11: super ("meta");
12: this .page = page;
13: }
14:
15: public void process(Tag tag) {
16: if (tag.hasAttribute("name", false)) {
17: page.addProperty("meta."
18: + tag.getAttributeValue("name", false), tag
19: .getAttributeValue("content", false));
20: } else if (tag.hasAttribute("http-equiv", false)) {
21: page.addProperty("meta.http-equiv."
22: + tag.getAttributeValue("http-equiv", false), tag
23: .getAttributeValue("content", false));
24: }
25: tag.writeTo(currentBuffer());
26: }
27: }
|