All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Acme.HtmlEditScanner

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----java.io.FilterInputStream
                   |
                   +----Acme.HtmlEditScanner

public class HtmlEditScanner
extends FilterInputStream
implements HtmlObserver
An HTML scanner with editing.

This is like HtmlScanner but it lets you make changes to the URLs in the HTML stream you are scanning. The regular scanner class lets you define callbacks that get called with the URLs; in this version, you can return substitute URLs from the callbacks, and they get inserted into the stream in place of the old URLs.

Fetch the software.
Fetch the entire Acme package.


Constructor Index

 o HtmlEditScanner(HtmlScanner, HtmlEditObserver)
Constructor with a pre-made HtmlScanner.
 o HtmlEditScanner(HtmlScanner, HtmlEditObserver, Object)
Constructor with a pre-made HtmlScanner, with clientData.
 o HtmlEditScanner(InputStream, URL, HtmlEditObserver)
Constructor.
 o HtmlEditScanner(InputStream, URL, HtmlEditObserver, Object)
Constructor with clientData.

Method Index

 o addObserver(HtmlEditObserver)
Add an extra observer to this editor.
 o addObserver(HtmlEditObserver, Object)
Add an extra observer to this editor.
 o gotAHREF(String, URL, Object)
Callback from HtmlScanner.
 o gotAREAHREF(String, URL, Object)
Callback from HtmlScanner.
 o gotBASEHREF(String, URL, Object)
Callback from HtmlScanner.
 o gotBODYBACKGROUND(String, URL, Object)
Callback from HtmlScanner.
 o gotFRAMESRC(String, URL, Object)
Callback from HtmlScanner.
 o gotIMGSRC(String, URL, Object)
Callback from HtmlScanner.
 o gotLINKHREF(String, URL, Object)
Callback from HtmlScanner.
 o read()
Override to make sure this goes through the above read( byte[], int, int) method.
 o read(byte[], int, int)
Special version of read() that's careful about URLs split across buffer-loads.

Constructors

 o HtmlEditScanner
 public HtmlEditScanner(InputStream s,
                        URL thisUrl,
                        HtmlEditObserver observer)
Constructor. If the client is not interested in getting called back with URLs, observer can be null (but then there's not much point in using this class).

 o HtmlEditScanner
 public HtmlEditScanner(InputStream s,
                        URL thisUrl,
                        HtmlEditObserver observer,
                        Object clientData)
Constructor with clientData. If the client is not interested in getting called back with URLs, observer can be null (but then there's not much point in using this class).

 o HtmlEditScanner
 public HtmlEditScanner(HtmlScanner scanner,
                        HtmlEditObserver observer)
Constructor with a pre-made HtmlScanner. If the client is not interested in getting called back with URLs, observer can be null (but then there's not much point in using this class).

 o HtmlEditScanner
 public HtmlEditScanner(HtmlScanner scanner,
                        HtmlEditObserver observer,
                        Object clientData)
Constructor with a pre-made HtmlScanner, with clientData. If the client is not interested in getting called back with URLs, observer can be null (but then there's not much point in using this class).

Methods

 o addObserver
 public void addObserver(HtmlEditObserver observer)
Add an extra observer to this editor. Multiple observers get called in the order they were added.

 o addObserver
 public void addObserver(HtmlEditObserver observer,
                         Object clientData)
Add an extra observer to this editor. Multiple observers get called in the order they were added.

 o read
 public int read(byte b[],
                 int off,
                 int len) throws IOException
Special version of read() that's careful about URLs split across buffer-loads.

Overrides:
read in class FilterInputStream
 o read
 public int read() throws IOException
Override to make sure this goes through the above read( byte[], int, int) method.

Overrides:
read in class FilterInputStream
 o gotAHREF
 public void gotAHREF(String urlStr,
                      URL contextUrl,
                      Object junk)
Callback from HtmlScanner.

 o gotIMGSRC
 public void gotIMGSRC(String urlStr,
                       URL contextUrl,
                       Object junk)
Callback from HtmlScanner.

 o gotFRAMESRC
 public void gotFRAMESRC(String urlStr,
                         URL contextUrl,
                         Object junk)
Callback from HtmlScanner.

 o gotBASEHREF
 public void gotBASEHREF(String urlStr,
                         URL contextUrl,
                         Object junk)
Callback from HtmlScanner.

 o gotAREAHREF
 public void gotAREAHREF(String urlStr,
                         URL contextUrl,
                         Object junk)
Callback from HtmlScanner.

 o gotLINKHREF
 public void gotLINKHREF(String urlStr,
                         URL contextUrl,
                         Object junk)
Callback from HtmlScanner.

 o gotBODYBACKGROUND
 public void gotBODYBACKGROUND(String urlStr,
                               URL contextUrl,
                               Object junk)
Callback from HtmlScanner.


All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs