All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class hplb.xml.util.HtmlScanner

java.lang.Object
   |
   +----org.xml.sax.HandlerBase
           |
           +----hplb.xml.util.HtmlScanner

public class HtmlScanner
extends HandlerBase
The HtmlScanner parses an HTML document for elements containing links. For each link found it will invoke a client-provided callback method. It knows about most HTML4.0 links and also knows about the <base>.

For an example use see UrlScanner.

Author:
Anders Kristensen
See Also:
HtmlObserver, UrlScanner

Constructor Index

 o HtmlScanner(InputStream, URL, HtmlObserver)
Parse the input on the specified stream as if it was HTML and invoke the provided observer as links are encountered.
 o HtmlScanner(InputStream, URL, HtmlObserver, Object)
Parse the input on the specified stream as if it was HTML and invoke the provided observer as links are encountered.
 o HtmlScanner(URL, HtmlObserver)
Parse the input on the specified stream as if it was HTML and invoke the provided observer as links are encountered.

Method Index

 o startElement(String, AttributeMap)
Handle a start element event.

Constructors

 o HtmlScanner
 public HtmlScanner(URL url,
                    HtmlObserver observer) throws Exception
Parse the input on the specified stream as if it was HTML and invoke the provided observer as links are encountered.

Parameters:
url - the URL to parse for links
observer - the callback object
data - client-specific data; this is passed back to the client in callbacks; this scanner doesn't use it
See Also:
parse
 o HtmlScanner
 public HtmlScanner(InputStream in,
                    URL url,
                    HtmlObserver observer) throws Exception
Parse the input on the specified stream as if it was HTML and invoke the provided observer as links are encountered.

Parameters:
in - the input stream
url - the URL corresponding to this document
observer - the callback object
See Also:
parse
 o HtmlScanner
 public HtmlScanner(InputStream in,
                    URL url,
                    HtmlObserver observer,
                    Object data) throws Exception
Parse the input on the specified stream as if it was HTML and invoke the provided observer as links are encountered.

Parameters:
in - the input stream
url - the URL corresponding to this document
observer - the callback object
data - client-specific data; this is passed back to the client in callbacks; this scanner doesn't use it
See Also:
parse

Methods

 o startElement
 public void startElement(String name,
                          AttributeMap attributes)
Handle a start element event.

Overrides:
startElement in class HandlerBase

All Packages  Class Hierarchy  This Package  Previous  Next  Index