fi.hut.tml.xsmiles.xml
Class JaxpXMLParser

java.lang.Object
  extended byfi.hut.tml.xsmiles.xml.JaxpXMLParser
All Implemented Interfaces:
XMLParser

public class JaxpXMLParser
extends java.lang.Object
implements XMLParser

Contains the Jaxp XML DOM-implementation

Version:
$Revision: 6533 $
Author:
Mikko Honkala

Nested Class Summary
 class JaxpXMLParser.JAXPEntityResolver
           
 class JaxpXMLParser.JAXPErrorHandler
           
 
Field Summary
 org.xml.sax.SAXParseException lastParseException
           
 
Constructor Summary
JaxpXMLParser()
          Constructor.
 
Method Summary
 org.w3c.dom.Document createEmptyDocument()
           
 org.xml.sax.SAXParseException getLastParseException()
           
 org.w3c.dom.Document openDocument(org.xml.sax.InputSource input, java.lang.String documentClassname)
           
 org.w3c.dom.Document openDocument(java.io.InputStream sourceStream, boolean presentationDOM)
           
 org.w3c.dom.Document openDocument(java.io.InputStream sourceStream, boolean presentationDOM, java.lang.String documentURL)
          Reads a document from an InputStream into a DOM tree.
 org.w3c.dom.Document openDocument(java.io.Reader sourceReader, boolean presentationDOM)
          Reads an document to DOM tree
 org.w3c.dom.Document openDocument(java.net.URL url)
          Reads an document to DOM tree
 org.w3c.dom.Document openDocument(java.net.URL url, java.lang.String documentClassname)
           
 void setEntityResolver(org.xml.sax.EntityResolver handler, javax.xml.parsers.DocumentBuilder builder)
           
 void setErrorHandler(org.xml.sax.ErrorHandler handler, javax.xml.parsers.DocumentBuilder builder)
           
 java.lang.String write(org.w3c.dom.Node doc)
          Writes the dom node to a string.
 java.lang.String write(org.w3c.dom.Node doc, boolean prettyPrinting)
          Writes the dom node to a string.
 void write(java.io.Writer writer, org.w3c.dom.Node node, boolean prettyPrinting)
           
 void write(java.io.Writer writer, org.w3c.dom.Node doc, boolean preserveSpace, boolean indenting)
          The main write method, writes the DOM document to a Writer.
 void writeWithoutXMLDecl(java.io.Writer writer, org.w3c.dom.Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastParseException

public org.xml.sax.SAXParseException lastParseException
Constructor Detail

JaxpXMLParser

public JaxpXMLParser()
Constructor. Creates a new instance of the DOM-parser.

Method Detail

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler handler,
                            javax.xml.parsers.DocumentBuilder builder)

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver handler,
                              javax.xml.parsers.DocumentBuilder builder)

openDocument

public org.w3c.dom.Document openDocument(java.io.Reader sourceReader,
                                         boolean presentationDOM)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Reads an document to DOM tree

Specified by:
openDocument in interface XMLParser
Returns:
read DOM document.
Throws:
java.io.IOException
org.xml.sax.SAXException

openDocument

public org.w3c.dom.Document openDocument(java.io.InputStream sourceStream,
                                         boolean presentationDOM,
                                         java.lang.String documentURL)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Reads a document from an InputStream into a DOM tree. This method was added for i18n. A parser assumes that a Reader source is already in Unicode, whereas it will check the xml header for the encoding of an InputStream.

Specified by:
openDocument in interface XMLParser
Returns:
read DOM document.
Throws:
java.io.IOException
org.xml.sax.SAXException

openDocument

public org.w3c.dom.Document openDocument(java.io.InputStream sourceStream,
                                         boolean presentationDOM)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Specified by:
openDocument in interface XMLParser
Throws:
java.io.IOException
org.xml.sax.SAXException

openDocument

public org.w3c.dom.Document openDocument(java.net.URL url)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Reads an document to DOM tree

Specified by:
openDocument in interface XMLParser
Returns:
read DOM document.
Throws:
java.io.IOException
org.xml.sax.SAXException

openDocument

public org.w3c.dom.Document openDocument(java.net.URL url,
                                         java.lang.String documentClassname)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Specified by:
openDocument in interface XMLParser
Throws:
java.io.IOException
org.xml.sax.SAXException

openDocument

public org.w3c.dom.Document openDocument(org.xml.sax.InputSource input,
                                         java.lang.String documentClassname)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Throws:
java.io.IOException
org.xml.sax.SAXException

createEmptyDocument

public org.w3c.dom.Document createEmptyDocument()
Specified by:
createEmptyDocument in interface XMLParser

write

public java.lang.String write(org.w3c.dom.Node doc)
Writes the dom node to a string. Note! Uses Jaxp transformations.

Specified by:
write in interface XMLParser

write

public void write(java.io.Writer writer,
                  org.w3c.dom.Node node,
                  boolean prettyPrinting)
Specified by:
write in interface XMLParser

write

public java.lang.String write(org.w3c.dom.Node doc,
                              boolean prettyPrinting)
Writes the dom node to a string. Note! Uses Jaxp transformations.

Specified by:
write in interface XMLParser

write

public void write(java.io.Writer writer,
                  org.w3c.dom.Node doc,
                  boolean preserveSpace,
                  boolean indenting)
The main write method, writes the DOM document to a Writer. Note! Uses Jaxp transformations

Parameters:
preserveSpace - preserves the white space in the document

writeWithoutXMLDecl

public void writeWithoutXMLDecl(java.io.Writer writer,
                                org.w3c.dom.Node node)
                         throws java.io.IOException
Specified by:
writeWithoutXMLDecl in interface XMLParser
Throws:
java.io.IOException

getLastParseException

public org.xml.sax.SAXParseException getLastParseException()
Specified by:
getLastParseException in interface XMLParser


X-Smiles 1.2