xml.parser.javacc
Class XmlCollector

java.lang.Object
  extended by xml.parser.javacc.XmlVisitor
      extended by xml.parser.javacc.XmlCollector

public class XmlCollector
extends XmlVisitor

An XmlVisitor which modifies the structure of the document so that begin tags are matched properly with end tags and placed in TagBlock elements. Typically, an XmlDocument is created by the parser, which simply returns a flat list of elements. The XmlCollector 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  xml.parser.javacc.XmlCollector.ElementStack elements
           
protected  xml.parser.javacc.XmlCollector.ElementStack tagStack
           
 
Constructor Summary
XmlCollector()
           
 
Method Summary
static void main(java.lang.String[] args)
           
protected  int pushNode(XmlDocument.XmlElement e)
           
 void visit(XmlDocument.Comment c)
           
 void visit(XmlDocument.ElementSequence s)
           
 void visit(XmlDocument.EndTag t)
           
 void visit(XmlDocument.Newline n)
           
 void visit(XmlDocument.Tag t)
           
 void visit(XmlDocument.TagBlock bl)
           
 void visit(XmlDocument.Text t)
           
 
Methods inherited from class xml.parser.javacc.XmlVisitor
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 xml.parser.javacc.XmlCollector.ElementStack tagStack

elements

protected xml.parser.javacc.XmlCollector.ElementStack elements

collected

protected boolean collected
Constructor Detail

XmlCollector

public XmlCollector()
Method Detail

pushNode

protected int pushNode(XmlDocument.XmlElement e)

visit

public void visit(XmlDocument.Comment c)
Overrides:
visit in class XmlVisitor

visit

public void visit(XmlDocument.Text t)
Overrides:
visit in class XmlVisitor

visit

public void visit(XmlDocument.Newline n)
Overrides:
visit in class XmlVisitor

visit

public void visit(XmlDocument.Tag t)
Overrides:
visit in class XmlVisitor

visit

public void visit(XmlDocument.EndTag t)
Overrides:
visit in class XmlVisitor

visit

public void visit(XmlDocument.TagBlock bl)
Overrides:
visit in class XmlVisitor

visit

public void visit(XmlDocument.ElementSequence s)
Overrides:
visit in class XmlVisitor

main

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