01: package com.opensymphony.module.sitemesh.html.rules;
02:
03: import com.opensymphony.module.sitemesh.html.BlockExtractingRule;
04: import com.opensymphony.module.sitemesh.html.Tag;
05:
06: public class ContentBlockExtractingRule extends BlockExtractingRule {
07:
08: private final PageBuilder page;
09:
10: private String contentBlockId;
11:
12: public ContentBlockExtractingRule(PageBuilder page) {
13: super (false, "content");
14: this .page = page;
15: }
16:
17: protected void start(Tag tag) {
18: contentBlockId = tag.getAttributeValue("tag", false);
19: }
20:
21: protected void end(Tag tag) {
22: page.addProperty("page." + contentBlockId, currentBuffer()
23: .toString());
24: }
25:
26: }
|