org.apache.jetspeed.util.rewriter
Class HTMLRewriter

java.lang.Object
  extended byorg.apache.jetspeed.util.rewriter.HTMLRewriter
All Implemented Interfaces:
Rewriter
Direct Known Subclasses:
ClipperRewriter, SampleRewriter

public class HTMLRewriter
extends java.lang.Object
implements Rewriter

Basic Rewriter for rewriting HTML content.

Version:
$Id: HTMLRewriter.java,v 1.6 2004/02/23 03:18:59 jford Exp $
Author:
David Sean Taylor

Field Summary
protected  java.lang.String baseURL
           
 
Constructor Summary
HTMLRewriter()
           
 
Method Summary
 void convertTagEvent(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attrs)
           
 boolean enterEndTagEvent(javax.swing.text.html.HTML.Tag tag)
           
 boolean enterSimpleTagEvent(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attrs)
           
 boolean enterStartTagEvent(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attrs)
           
 boolean enterText(char[] values, int param)
           
 java.lang.String exitEndTagEvent(javax.swing.text.html.HTML.Tag tag)
           
 java.lang.String exitSimpleTagEvent(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attrs)
           
 java.lang.String exitStartTagEvent(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attrs)
           
 java.lang.String generateNewUrl(java.lang.String targetURL, javax.swing.text.html.HTML.Tag tag, javax.swing.text.html.HTML.Attribute attribute)
           
 boolean proxyAllTags()
           
 java.lang.String rewrite(java.io.Reader input, java.lang.String baseURL)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseURL

protected java.lang.String baseURL
Constructor Detail

HTMLRewriter

public HTMLRewriter()
Method Detail

generateNewUrl

public java.lang.String generateNewUrl(java.lang.String targetURL,
                                       javax.swing.text.html.HTML.Tag tag,
                                       javax.swing.text.html.HTML.Attribute attribute)
Specified by:
generateNewUrl in interface Rewriter

proxyAllTags

public boolean proxyAllTags()
Specified by:
proxyAllTags in interface Rewriter

rewrite

public java.lang.String rewrite(java.io.Reader input,
                                java.lang.String baseURL)
                         throws java.net.MalformedURLException
Specified by:
rewrite in interface Rewriter
Throws:
java.net.MalformedURLException

enterSimpleTagEvent

public boolean enterSimpleTagEvent(javax.swing.text.html.HTML.Tag tag,
                                   javax.swing.text.MutableAttributeSet attrs)
Specified by:
enterSimpleTagEvent in interface Rewriter

exitSimpleTagEvent

public java.lang.String exitSimpleTagEvent(javax.swing.text.html.HTML.Tag tag,
                                           javax.swing.text.MutableAttributeSet attrs)
Specified by:
exitSimpleTagEvent in interface Rewriter

enterStartTagEvent

public boolean enterStartTagEvent(javax.swing.text.html.HTML.Tag tag,
                                  javax.swing.text.MutableAttributeSet attrs)
Specified by:
enterStartTagEvent in interface Rewriter

exitStartTagEvent

public java.lang.String exitStartTagEvent(javax.swing.text.html.HTML.Tag tag,
                                          javax.swing.text.MutableAttributeSet attrs)
Specified by:
exitStartTagEvent in interface Rewriter

enterEndTagEvent

public boolean enterEndTagEvent(javax.swing.text.html.HTML.Tag tag)
Specified by:
enterEndTagEvent in interface Rewriter

exitEndTagEvent

public java.lang.String exitEndTagEvent(javax.swing.text.html.HTML.Tag tag)
Specified by:
exitEndTagEvent in interface Rewriter

enterText

public boolean enterText(char[] values,
                         int param)
Specified by:
enterText in interface Rewriter

convertTagEvent

public void convertTagEvent(javax.swing.text.html.HTML.Tag tag,
                            javax.swing.text.MutableAttributeSet attrs)
Specified by:
convertTagEvent in interface Rewriter


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.