org.sitemesh.content.tagrules.html
Class ContentBlockExtractingRule
java.lang.Object
org.sitemesh.tagprocessor.BasicRule
org.sitemesh.tagprocessor.BasicBlockRule<String>
org.sitemesh.content.tagrules.html.ContentBlockExtractingRule
- All Implemented Interfaces:
- TagRule
public class ContentBlockExtractingRule
- extends BasicBlockRule<String>
Extracts the contents of any elements that look like
<content tag='foo'>...</content> and write the contents
to a page property (page.foo).
This is a cheap and cheerful mechanism for embedding multiple components in a
page that can be used in different places in decorators.
- Author:
- Joe Walnes
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContentBlockExtractingRule
public ContentBlockExtractingRule(ContentProperty propertyToExport)
processStart
protected String processStart(Tag tag)
throws IOException
- Description copied from class:
BasicBlockRule
- Called when a block is started (i.e.
<opening> tag is encountered).
- Specified by:
processStart in class BasicBlockRule<String>
- Parameters:
tag - Opening tag.
- Returns:
- Any data that needs to be passed to
BasicBlockRule.processEnd(Tag, Object). May be null.
- Throws:
IOException
processEnd
protected void processEnd(Tag tag,
String tagId)
throws IOException
- Description copied from class:
BasicBlockRule
- Called when a block is ended (i.e.
</closing> tag is encountered).
- Specified by:
processEnd in class BasicBlockRule<String>
- Parameters:
tag - Closing tag. This will not have any attributes available (as they are associated
with an opening tag. To get access to the attributes, the BasicBlockRule.processStart(Tag) method
should access them and return them as data.tagId - Data returned from BasicBlockRule.processStart(Tag). May be null.
- Throws:
IOException
Copyright © 2011. All Rights Reserved.