org.apache.jetspeed.rewriter
Class BasicRewriter

java.lang.Object
  extended by org.apache.jetspeed.rewriter.AbstractRewriter
      extended by org.apache.jetspeed.rewriter.BasicRewriter
All Implemented Interfaces:
Rewriter
Direct Known Subclasses:
RulesetRewriterImpl, TicketParamRewriter

public class BasicRewriter
extends AbstractRewriter
implements Rewriter

BasicRewriter

Version:
$Id: BasicRewriter.java 516448 2007-03-09 16:25:47Z ate $
Author:
David Sean Taylor

Field Summary
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
BasicRewriter()
           
 
Method Summary
 String rewriteUrl(String url, String tag, String attribute)
          This event is the inteface between the Rewriter and ParserAdaptor for rewriting URLs.
 boolean shouldRemoveComments()
          Returns true if all comments should be removed.
 boolean shouldRemoveTag(String tag)
          Returns true if the tag should be removed, otherwise false.
 boolean shouldStripTag(String tag)
          Returns true if the tag should be stripped, otherwise false.
 
Methods inherited from class org.apache.jetspeed.rewriter.AbstractRewriter
enterConvertTagEvent, enterEndTagEvent, enterSimpleTagEvent, enterStartTagEvent, enterText, exitEndTagEvent, exitSimpleTagEvent, exitStartTagEvent, getBaseRelativeUrl, getBaseUrl, getUseProxy, parse, rewrite, setBaseUrl, setUseProxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.rewriter.Rewriter
enterConvertTagEvent, enterEndTagEvent, enterSimpleTagEvent, enterStartTagEvent, enterText, exitEndTagEvent, exitSimpleTagEvent, exitStartTagEvent, getBaseRelativeUrl, getBaseUrl, getUseProxy, parse, rewrite, setBaseUrl, setUseProxy
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Constructor Detail

BasicRewriter

public BasicRewriter()
Method Detail

rewriteUrl

public String rewriteUrl(String url,
                         String tag,
                         String attribute)
Description copied from interface: Rewriter
This event is the inteface between the Rewriter and ParserAdaptor for rewriting URLs. The ParserAdaptor calls back the Rewriter when it finds a URL that is a candidate to be rewritten. The Rewriter rewrites the URL and returns it as the result of this function.

Specified by:
rewriteUrl in interface Rewriter
Specified by:
rewriteUrl in class AbstractRewriter
Parameters:
url - the URL to be rewritten
tag - The tag being processed
attribute - The current attribute being processsed

shouldRemoveTag

public boolean shouldRemoveTag(String tag)
Description copied from interface: Rewriter
Returns true if the tag should be removed, otherwise false. Removing a tag only removes the tag but not the contents in between the start and end tag.

Specified by:
shouldRemoveTag in interface Rewriter
Returns:
true if the tag should be removed.

shouldStripTag

public boolean shouldStripTag(String tag)
Description copied from interface: Rewriter
Returns true if the tag should be stripped, otherwise false. Stripping tags removes the start and end tag, plus all tags and content in between the start and end tag.

Specified by:
shouldStripTag in interface Rewriter
Returns:
true if the tag should be stripped.

shouldRemoveComments

public boolean shouldRemoveComments()
Description copied from interface: Rewriter
Returns true if all comments should be removed.

Specified by:
shouldRemoveComments in interface Rewriter
Returns:
true If all comments should be removed.


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.