com.opensymphony.module.sitemesh.html.rules
Class TagReplaceRule

java.lang.Object
  extended by com.opensymphony.module.sitemesh.html.BasicRule
      extended by com.opensymphony.module.sitemesh.html.rules.TagReplaceRule
All Implemented Interfaces:
TagRule

public class TagReplaceRule
extends BasicRule

Very simple rule for replacing all occurences of one tag with another.

For example, to convert all <b> tags to <strong>:

html.addRule(new TagReplaceRule("b", "strong"));

Author:
Joe Walnes

Field Summary
private  java.lang.String newTagName
           
 
Fields inherited from class com.opensymphony.module.sitemesh.html.BasicRule
context
 
Constructor Summary
TagReplaceRule(java.lang.String originalTagName, java.lang.String newTagName)
           
 
Method Summary
 void process(Tag tag)
           
 
Methods inherited from class com.opensymphony.module.sitemesh.html.BasicRule
currentBuffer, setContext, shouldProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newTagName

private final java.lang.String newTagName
Constructor Detail

TagReplaceRule

public TagReplaceRule(java.lang.String originalTagName,
                      java.lang.String newTagName)
Method Detail

process

public void process(Tag tag)
Specified by:
process in interface TagRule
Specified by:
process in class BasicRule

www.opensymphony.com/sitemesh/