rabbit.filter
Class LowresImageFilter

java.lang.Object
  extended by rabbit.filter.HtmlFilter
      extended by rabbit.filter.SimpleTagFilter
          extended by rabbit.filter.LowresImageFilter
All Implemented Interfaces:
HtmlFilterFactory

public class LowresImageFilter
extends SimpleTagFilter

This filter removes the "lowsrc=some_image.gif" attributes from the <img> tags.

Author:
Robert Olofsson

Field Summary
 
Fields inherited from class rabbit.filter.HtmlFilter
con, request, response
 
Constructor Summary
LowresImageFilter()
           
LowresImageFilter(Connection con, HttpHeader request, HttpHeader response)
          Create a new LowresImageFilter for the given request, response pair.
 
Method Summary
 void handleTag(Tag tag, HtmlBlock block, int tokenIndex)
          remove the lowres tags.
 HtmlFilter newFilter(Connection con, HttpHeader request, HttpHeader response)
          Get a new HtmlFilter for the given request, response pair.
 
Methods inherited from class rabbit.filter.SimpleTagFilter
filterHtml
 
Methods inherited from class rabbit.filter.HtmlFilter
isCacheable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LowresImageFilter

public LowresImageFilter()

LowresImageFilter

public LowresImageFilter(Connection con,
                         HttpHeader request,
                         HttpHeader response)
Create a new LowresImageFilter for the given request, response pair.

Parameters:
con - the Connection handling the request.
request - the actual request made.
response - the actual response being sent.
Method Detail

newFilter

public HtmlFilter newFilter(Connection con,
                            HttpHeader request,
                            HttpHeader response)
Description copied from interface: HtmlFilterFactory
Get a new HtmlFilter for the given request, response pair.

Parameters:
con - the Connection handling the request.
request - the actual request made.
response - the actual response being sent.

handleTag

public void handleTag(Tag tag,
                      HtmlBlock block,
                      int tokenIndex)
remove the lowres tags.

Specified by:
handleTag in class SimpleTagFilter
Parameters:
block - the part of the html page we are filtering.
tag - the Tag to handle.
tokenIndex - the index of the current Token