org.sitemesh.content.tagrules.decorate
Class SiteMeshDecorateRule
java.lang.Object
org.sitemesh.tagprocessor.BasicRule
org.sitemesh.tagprocessor.BasicBlockRule<org.sitemesh.content.tagrules.decorate.SiteMeshDecorateRule.Holder>
org.sitemesh.content.tagrules.decorate.SiteMeshDecorateRule
- All Implemented Interfaces:
- TagRule
public class SiteMeshDecorateRule
- extends BasicBlockRule<org.sitemesh.content.tagrules.decorate.SiteMeshDecorateRule.Holder>
Rule that applies decorators to inline blocks of content.
- A
ContentProperty object will be created for the inline block.
- The contents of the tag body will be exposed as the
body property.
- All attributes of the tag will be copied as named properties (see example below).
- The
decorator attribute will specify which decorator is used.
Example
Some content <sitemesh:decorate decorator='/mydecorator' title='foo' cheese='bar'>blah</sitemesh:decorate>
This will apply the decorator named /mydecorator, passing in ContentProperty
with the following properties:
body=blah
title=foo
cheese=bar
- Author:
- Joe Walnes
|
Method Summary |
protected void |
processEnd(Tag tag,
org.sitemesh.content.tagrules.decorate.SiteMeshDecorateRule.Holder holder)
Called when a block is ended (i.e. |
protected org.sitemesh.content.tagrules.decorate.SiteMeshDecorateRule.Holder |
processStart(Tag tag)
Called when a block is started (i.e. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SiteMeshDecorateRule
public SiteMeshDecorateRule(SiteMeshContext siteMeshContext)
processStart
protected org.sitemesh.content.tagrules.decorate.SiteMeshDecorateRule.Holder 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<org.sitemesh.content.tagrules.decorate.SiteMeshDecorateRule.Holder>
- 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,
org.sitemesh.content.tagrules.decorate.SiteMeshDecorateRule.Holder holder)
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<org.sitemesh.content.tagrules.decorate.SiteMeshDecorateRule.Holder>
- 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.holder - Data returned from BasicBlockRule.processStart(Tag). May be null.
- Throws:
IOException
Copyright © 2011. All Rights Reserved.