org.pf.pax
Class DOMTreeXMLReader

java.lang.Object
  extended by org.pf.pax.DOMTreeXMLReader
All Implemented Interfaces:
SAXConstants, org.xml.sax.XMLReader

public class DOMTreeXMLReader
extends java.lang.Object
implements org.xml.sax.XMLReader, SAXConstants

This parser implements the org.xml.sax.Parser interface, but uses a DOM tree as input rather than a XML stream.
So this class enables developers to use a DOM tree as source for being handled by a ContentHandler. Of course this also includes to use a DOM tree as source for the XMLTagInterpreter functionality of PAX.

Version:
2.2
Author:
Manfred Duchrow

Field Summary
 
Fields inherited from interface org.pf.pax.SAXConstants
FEATURE_NAMESPACE_PREFIXES, FEATURE_NAMESPACES, FEATURE_VALIDATING
 
Constructor Summary
DOMTreeXMLReader()
          Initialize the new instance with default values.
 
Method Summary
 org.xml.sax.ContentHandler getContentHandler()
           
 org.xml.sax.DTDHandler getDTDHandler()
          This method is not supported !
 org.xml.sax.EntityResolver getEntityResolver()
          This method is not supported !
 org.xml.sax.ErrorHandler getErrorHandler()
          This method is not supported !
 boolean getFeature(java.lang.String name)
          Returns whether or not the feature with the given name is on.
 java.lang.Object getProperty(java.lang.String name)
          This method is not supported !
 void parse(org.w3c.dom.Document document)
          This method iterates over all elements of the specified DOM document and calls the corresponding callback-methods of its ContentHandler.
 void parse(org.xml.sax.InputSource source)
          This method is not allowed here, because this parser can handle Document Object Model documents only !
 void parse(java.lang.String systemId)
          This method is not allowed here, because this parser can handle Document Object Model documents only !
 void setContentHandler(org.xml.sax.ContentHandler newValue)
          Allow an application to register a document event handler.
 void setDTDHandler(org.xml.sax.DTDHandler handler)
          This method is not supported !
 void setEntityResolver(org.xml.sax.EntityResolver resolver)
          This method is not supported !
 void setErrorHandler(org.xml.sax.ErrorHandler handler)
          This method is not supported !
 void setFeature(java.lang.String name, boolean value)
          Switch the feature with the given name on or off.
 void setLocale(java.util.Locale locale)
          This method is not supported !
 void setProperty(java.lang.String name, java.lang.Object value)
          This method is not supported !
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMTreeXMLReader

public DOMTreeXMLReader()
Initialize the new instance with default values.

Method Detail

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler newValue)
Allow an application to register a document event handler.

Specified by:
setContentHandler in interface org.xml.sax.XMLReader

parse

public void parse(org.w3c.dom.Document document)
           throws org.xml.sax.SAXException
This method iterates over all elements of the specified DOM document and calls the corresponding callback-methods of its ContentHandler.

Throws:
org.xml.sax.SAXException

parse

public void parse(org.xml.sax.InputSource source)
           throws org.xml.sax.SAXException
This method is not allowed here, because this parser can handle Document Object Model documents only !
Therefore this method throws always an Exception !

Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXException

parse

public void parse(java.lang.String systemId)
           throws org.xml.sax.SAXException
This method is not allowed here, because this parser can handle Document Object Model documents only !
Therefore this method throws always an Exception !

Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXException

setDTDHandler

public void setDTDHandler(org.xml.sax.DTDHandler handler)
This method is not supported !
It's just an empty implementation that does nothing.

Specified by:
setDTDHandler in interface org.xml.sax.XMLReader

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver resolver)
This method is not supported !
It's just an empty implementation that does nothing.

Specified by:
setEntityResolver in interface org.xml.sax.XMLReader

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler handler)
This method is not supported !
It's just an empty implementation that does nothing.

Specified by:
setErrorHandler in interface org.xml.sax.XMLReader

setLocale

public void setLocale(java.util.Locale locale)
               throws org.xml.sax.SAXException
This method is not supported !
Therefore this method throws always an Exception !

Throws:
org.xml.sax.SAXException

getProperty

public java.lang.Object getProperty(java.lang.String name)
                             throws org.xml.sax.SAXNotRecognizedException,
                                    org.xml.sax.SAXNotSupportedException
This method is not supported !
Therefore this method throws always an Exception !

Specified by:
getProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws org.xml.sax.SAXNotRecognizedException,
                        org.xml.sax.SAXNotSupportedException
This method is not supported !
Therefore this method throws always an Exception !

Specified by:
setProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

getFeature

public boolean getFeature(java.lang.String name)
                   throws org.xml.sax.SAXNotRecognizedException,
                          org.xml.sax.SAXNotSupportedException
Returns whether or not the feature with the given name is on.

Specified by:
getFeature in interface org.xml.sax.XMLReader
Parameters:
name - The name of the feature
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
                throws org.xml.sax.SAXNotRecognizedException,
                       org.xml.sax.SAXNotSupportedException
Switch the feature with the given name on or off.

Specified by:
setFeature in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

getDTDHandler

public org.xml.sax.DTDHandler getDTDHandler()
This method is not supported !
Therefore this method always returns null !

Specified by:
getDTDHandler in interface org.xml.sax.XMLReader

getErrorHandler

public org.xml.sax.ErrorHandler getErrorHandler()
This method is not supported !
Therefore this method always returns null !

Specified by:
getErrorHandler in interface org.xml.sax.XMLReader

getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()
This method is not supported !
Therefore this method always returns null !

Specified by:
getEntityResolver in interface org.xml.sax.XMLReader

getContentHandler

public org.xml.sax.ContentHandler getContentHandler()
Specified by:
getContentHandler in interface org.xml.sax.XMLReader