com.quiotix.html.parser
Class HtmlCollector

java.lang.Object
  extended bycom.quiotix.html.parser.HtmlVisitor
      extended bycom.quiotix.html.parser.HtmlCollector

public class HtmlCollector
extends HtmlVisitor

An HtmlVisitor which modifies the structure of the document so that begin tags are matched properly with end tags and placed in TagBlock elements. Typically, an HtmlDocument is created by the parser, which simply returns a flat list of elements. The HtmlCollector takes this flat list and gives it the structure that is implied by the HTML content.

Author:
Brian Goetz, Quiotix

Field Summary
protected  boolean collected
           
protected static java.util.Hashtable dontMatch
           
protected static java.lang.String[] dontMatchStrings
           
protected  com.quiotix.html.parser.HtmlCollector.MyVector elements
           
protected  com.quiotix.html.parser.HtmlCollector.MyVector tagStack
           
 
Constructor Summary
HtmlCollector()
           
 
Method Summary
 void finish()
           
static void main(java.lang.String[] args)
           
protected  int pushNode(HtmlDocument.HtmlElement e)
           
 void start()
           
 void visit(HtmlDocument.Comment c)
           
 void visit(HtmlDocument.ElementSequence s)
           
 void visit(HtmlDocument.EndTag t)
           
 void visit(HtmlDocument.Newline n)
           
 void visit(HtmlDocument.Tag t)
           
 void visit(HtmlDocument.TagBlock bl)
           
 void visit(HtmlDocument.Text t)
           
 
Methods inherited from class com.quiotix.html.parser.HtmlVisitor
visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tagStack

protected com.quiotix.html.parser.HtmlCollector.MyVector tagStack

elements

protected com.quiotix.html.parser.HtmlCollector.MyVector elements

collected

protected boolean collected

dontMatch

protected static java.util.Hashtable dontMatch

dontMatchStrings

protected static java.lang.String[] dontMatchStrings
Constructor Detail

HtmlCollector

public HtmlCollector()
Method Detail

pushNode

protected int pushNode(HtmlDocument.HtmlElement e)

visit

public void visit(HtmlDocument.Comment c)
Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.Text t)
Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.Newline n)
Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.Tag t)
Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.EndTag t)
Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.TagBlock bl)
Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.ElementSequence s)
Overrides:
visit in class HtmlVisitor

start

public void start()
Overrides:
start in class HtmlVisitor

finish

public void finish()
Overrides:
finish in class HtmlVisitor

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception