com.quiotix.html.parser
Class HtmlCollector

java.lang.Object
  extended by com.quiotix.html.parser.HtmlVisitor
      extended by 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 Set dontMatch
           
protected static String[] dontMatchStrings
           
protected  com.quiotix.html.parser.HtmlCollector.ElementStack elements
           
protected  com.quiotix.html.parser.HtmlCollector.ElementStack tagStack
           
 
Constructor Summary
HtmlCollector()
           
 
Method Summary
static void main(String[] args)
          Runnable.
protected  int pushNode(HtmlDocument.HtmlElement e)
           
 void visit(HtmlDocument.Comment c)
          Visit a Comment.
 void visit(HtmlDocument.ElementSequence s)
          Visit an ElementSequence.
 void visit(HtmlDocument.EndTag t)
          Visit an EndTag.
 void visit(HtmlDocument.Newline n)
          Visit a Newline.
 void visit(HtmlDocument.Tag t)
          Visit a Tag.
 void visit(HtmlDocument.TagBlock bl)
          Visit a TagBlock.
 void visit(HtmlDocument.Text t)
          Visit Text.
 
Methods inherited from class com.quiotix.html.parser.HtmlVisitor
finish, start, 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.ElementStack tagStack

elements

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

collected

protected boolean collected

dontMatch

protected static Set dontMatch

dontMatchStrings

protected static String[] dontMatchStrings
Constructor Detail

HtmlCollector

public HtmlCollector()
Method Detail

pushNode

protected int pushNode(HtmlDocument.HtmlElement e)

visit

public void visit(HtmlDocument.Comment c)
Description copied from class: HtmlVisitor
Visit a Comment.

Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.Text t)
Description copied from class: HtmlVisitor
Visit Text.

Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.Newline n)
Description copied from class: HtmlVisitor
Visit a Newline.

Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.Tag t)
Description copied from class: HtmlVisitor
Visit a Tag.

Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.EndTag t)
Description copied from class: HtmlVisitor
Visit an EndTag.

Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.TagBlock bl)
Description copied from class: HtmlVisitor
Visit a TagBlock.

Overrides:
visit in class HtmlVisitor

visit

public void visit(HtmlDocument.ElementSequence s)
Description copied from class: HtmlVisitor
Visit an ElementSequence.

Overrides:
visit in class HtmlVisitor

main

public static void main(String[] args)
                 throws Exception
Runnable.

Throws:
Exception


Copyright © 1999-2011 Quiotix. All Rights Reserved.