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.
|
process
setTagProcessorContext
public 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.ExportTagToContentRule
protected Object processStart(Tag tag) throws IOException
BasicBlockRule
<opening>
tag is encountered).processStart
in class BasicBlockRule
tag
- Opening tag.BasicBlockRule.processEnd(Tag, Object)
. May be null.IOException
protected void processEnd(Tag tag, Object data) throws IOException
BasicBlockRule
</closing>
tag is encountered).processEnd
in class BasicBlockRule
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.IOException
Copyright © 2015. All Rights Reserved.