public class ExportTagToContentRule extends BasicBlockRule
ContentProperty.
Additionally, if this tag has attributes, they will be written as child properties.
// Java
myState.addRule("foo", new ExportTagToContentRule(content, "bar");
// Input
<foo x=1 b=2>hello</foo>
// Exported properties of Content
bar=hello
bar.x=1
bar.b=2
tagProcessorContext| Constructor and Description |
|---|
ExportTagToContentRule(SiteMeshContext context,
ContentProperty targetProperty,
boolean includeInContent) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
processEnd(Tag tag,
Object data)
Called when a block is ended (i.e.
|
protected Object |
processStart(Tag tag)
Called when a block is started (i.e.
|
processsetTagProcessorContextpublic ExportTagToContentRule(SiteMeshContext context, ContentProperty targetProperty, boolean includeInContent)
targetProperty - ContentProperty to export tag contents to.includeInContent - Whether the tag should be included in the content (if false, it will be stripped
from the current ContentProperty that is being written to.ExportTagToContentRuleprotected Object processStart(Tag tag) throws IOException
BasicBlockRule<opening> tag is encountered).processStart in class BasicBlockRuletag - Opening tag.BasicBlockRule.processEnd(Tag, Object). May be null.IOExceptionprotected void processEnd(Tag tag, Object data) throws IOException
BasicBlockRule</closing> tag is encountered).processEnd in class BasicBlockRuletag - 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.IOExceptionCopyright © 2015. All Rights Reserved.