net.sourceforge.streamdom
Class DOMStreamBase

net.sourceforge.streamdom.DOMStreamBase
Direct Known Subclasses:
DOMStream, JDOMStream

public abstract class DOMStreamBase

This class provides common functionality to DOMStream and JDOMStream.

See Also:
JDOMStream, DOMStream

Field Summary
protected  java.util.HashSet handlers
           
 
Constructor Summary
DOMStreamBase()
           
 
Method Summary
protected abstract  void addContent(java.lang.String chars)
           
 void addIgnoredElementHandler(IgnoredElementHandler e)
          Provide a handler for DOM elements that will not be built.
 void characters(char[] c, int start, int length)
           
 void endDocument()
           
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
           
 void endPrefixMapping(java.lang.String prefix)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void ignoreElement(java.lang.String qualifiedName)
          Mark elements you don't wish to be notified about.
protected abstract  void initDocument()
           
protected abstract  void notifyHandlers()
           
protected abstract  void processElementEnd()
           
protected abstract  void processElementStart(java.lang.String qName, org.xml.sax.Attributes atts)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void removeIgnoredElementHandler(IgnoredElementHandler e)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void skippedEntity(java.lang.String name)
           
 void startDocument()
           
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 

Field Detail

handlers

protected java.util.HashSet handlers
Constructor Detail

DOMStreamBase

public DOMStreamBase()
Method Detail

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)

characters

public void characters(char[] c,
                       int start,
                       int length)

ignoreElement

public void ignoreElement(java.lang.String qualifiedName)
Mark elements you don't wish to be notified about. This is a convenient way to avoid memory usage and DOM-tree building for elements that are of no concern. Note that child elements of the element to be ignored will still be built and notified about. This behavior is especially useful for the element that may enclose an entire document. The names of elements thus ignored can be obtained by attaching an IgnoredElementHandler

initDocument

protected abstract void initDocument()

processElementStart

protected abstract void processElementStart(java.lang.String qName,
                                            org.xml.sax.Attributes atts)

addContent

protected abstract void addContent(java.lang.String chars)

notifyHandlers

protected abstract void notifyHandlers()

processElementEnd

protected abstract void processElementEnd()

addIgnoredElementHandler

public void addIgnoredElementHandler(IgnoredElementHandler e)
Provide a handler for DOM elements that will not be built. The IgnoredElementHandler tells you when an element to be ignored (not built) is encountered.

removeIgnoredElementHandler

public void removeIgnoredElementHandler(IgnoredElementHandler e)

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)

startDocument

public void startDocument()

endDocument

public void endDocument()

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)

skippedEntity

public void skippedEntity(java.lang.String name)