com.quiotix.html.parser
Class HtmlCollector
java.lang.Object
com.quiotix.html.parser.HtmlVisitor
com.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
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
HtmlCollector
public HtmlCollector()
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