org.sitemesh.content.tagrules.decorate
Class SiteMeshWriteRule
java.lang.Object
org.sitemesh.tagprocessor.BasicRule
org.sitemesh.tagprocessor.BasicBlockRule
org.sitemesh.content.tagrules.decorate.SiteMeshWriteRule
- All Implemented Interfaces:
- TagRule
public class SiteMeshWriteRule
- extends BasicBlockRule
Replaces tags that look like <sitemesh:write property='foo'/> with the
ContentProperty being merged into the current document. The body contents of the tag will be
discarded. To get child properties, use a dot notation, e.g. foo.child.grandchild.
- Author:
- Joe Walnes
- See Also:
SiteMeshContext.getContentToMerge()
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SiteMeshWriteRule
public SiteMeshWriteRule(SiteMeshContext siteMeshContext)
processStart
protected Object 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
- Parameters:
tag - Opening tag.
- Returns:
- Any data that needs to be passed to
BasicBlockRule.processEnd(Tag, Object). May be null.
- Throws:
IOException
getProperty
protected ContentProperty getProperty(Content content,
String propertyPath)
processEnd
protected void processEnd(Tag tag,
Object data)
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
- 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.data - Data returned from BasicBlockRule.processStart(Tag). May be null.
- Throws:
IOException
Copyright © 2011. All Rights Reserved.