org.apache.html.dom
Class HTMLBuilder
java.lang.Object
org.apache.html.dom.HTMLBuilder
- All Implemented Interfaces:
- DocumentHandler
public class HTMLBuilder
- extends Object
- implements DocumentHandler
This is a SAX document handler that is used to build an HTML document.
It can build a document from any SAX parser, but is specifically tuned
for working with the OpenXML HTML parser.
- Version:
- $Revision: 890459 $ $Date: 2009-12-14 14:55:41 -0500 (Mon, 14 Dec 2009) $
- Author:
- Assaf Arkin
Field Summary |
protected ElementImpl |
_current
The current node in the document into which elements, text and
other nodes will be inserted. |
protected HTMLDocumentImpl |
_document
The document that is being built. |
protected Vector |
_preRootNodes
The document is only created the same time as the document element, however, certain
nodes may precede the document element (comment and PI), and they are accumulated
in this vector. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_document
protected HTMLDocumentImpl _document
- The document that is being built.
_current
protected ElementImpl _current
- The current node in the document into which elements, text and
other nodes will be inserted. This starts as the document itself
and reflects each element that is currently being parsed.
_preRootNodes
protected Vector _preRootNodes
- The document is only created the same time as the document element, however, certain
nodes may precede the document element (comment and PI), and they are accumulated
in this vector.
HTMLBuilder
public HTMLBuilder()
startDocument
public void startDocument()
throws SAXException
- Specified by:
startDocument
in interface DocumentHandler
- Throws:
SAXException
endDocument
public void endDocument()
throws SAXException
- Specified by:
endDocument
in interface DocumentHandler
- Throws:
SAXException
startElement
public void startElement(String tagName,
AttributeList attrList)
throws SAXException
- Specified by:
startElement
in interface DocumentHandler
- Throws:
SAXException
endElement
public void endElement(String tagName)
throws SAXException
- Specified by:
endElement
in interface DocumentHandler
- Throws:
SAXException
characters
public void characters(String text)
throws SAXException
- Throws:
SAXException
characters
public void characters(char[] text,
int start,
int length)
throws SAXException
- Specified by:
characters
in interface DocumentHandler
- Throws:
SAXException
ignorableWhitespace
public void ignorableWhitespace(char[] text,
int start,
int length)
throws SAXException
- Specified by:
ignorableWhitespace
in interface DocumentHandler
- Throws:
SAXException
processingInstruction
public void processingInstruction(String target,
String instruction)
throws SAXException
- Specified by:
processingInstruction
in interface DocumentHandler
- Throws:
SAXException
getHTMLDocument
public org.w3c.dom.html.HTMLDocument getHTMLDocument()
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interface DocumentHandler
Copyright © 2011. All Rights Reserved.