Class JDOMSource.DocumentReader

java.lang.Object
  extended by SAXOutputter
      extended by JDOMSource.DocumentReader
All Implemented Interfaces:
org.xml.sax.XMLReader
Enclosing class:
JDOMSource
private static class JDOMSource.DocumentReader
extends SAXOutputter
implements org.xml.sax.XMLReader

An implementation of the SAX2 XMLReader interface that presents a SAX view of a JDOM Document. The actual generation of the SAX events is delegated to JDOM's SAXOutputter.

See Also:
Document, output.SAXOutputter

Constructor Summary
JDOMSource.DocumentReader()
          Public default constructor.
 
Method Summary
 voidparse(org.xml.sax.InputSource input)
          Parses an XML document.
 voidparse(java.lang.String systemId)
          Parses an XML document from a system identifier (URI).
 
Methods inherited from class SAXOutputter
createParser, getContentHandler, getDeclHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getLexicalHandler, getLocator, getProperty, getReportDTDEvents, getReportNamespaceDeclarations, output, output, output, outputFragment, outputFragment, setContentHandler, setDeclHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setLexicalHandler, setProperty, setReportDTDEvents, setReportNamespaceDeclarations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.XMLReader
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getProperty, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setProperty
 

Constructor Detail

JDOMSource.DocumentReader

public JDOMSource.DocumentReader()
Public default constructor.

Method Detail

parse

public void parse(java.lang.String systemId)
           throws org.xml.sax.SAXNotSupportedException
Parses an XML document from a system identifier (URI).

This implementation does not support reading XML data from system identifiers, only from JDOM documents. Hence, this method always throws a SAXNotSupportedException.

Specified by:
parse in interface org.xml.sax.XMLReader
Parameters:
systemId - the system identifier (URI).
Throws:
org.xml.sax.SAXNotSupportedException - always!

parse

public void parse(org.xml.sax.InputSource input)
           throws org.xml.sax.SAXException
Parses an XML document.

The methods accepts only JDOMInputSources instances as input sources.

Specified by:
parse in interface org.xml.sax.XMLReader
Parameters:
input - the input source for the top-level of the XML document.
Throws:
org.xml.sax.SAXException - any SAX exception, possibly wrapping another exception.
org.xml.sax.SAXNotSupportedException - if the input source does not wrap a JDOM document.