org.enhydra.barracuda.core.util.dom.io
Class DOMParser

java.lang.Object
  |
  +--org.enhydra.barracuda.core.util.dom.io.DOMParser

public class DOMParser
extends java.lang.Object

XML parser that parsers to a DOM. This implements the JAXP DOM parser interface plus the following additional features:


Constructor Summary
DOMParser()
           
 
Method Summary
 java.lang.String getDocumentClassName()
          get the document class for the document to construct.
 org.xml.sax.EntityResolver getEntityResolver()
          Get the EntityResolver
 org.xml.sax.ErrorHandler getErrorHandler()
          Get the ErrorHandler.
 boolean isNamespaceAware()
          Indicates whether or not this parser is configured to understand namespaces.
 boolean isValidating()
          Indicates whether or not this parser is configured to validate XML documents.
 org.w3c.dom.Document newDocument()
          Obtain a new instance of a DOM Document object to build a DOM tree with.
 org.w3c.dom.Document parse(org.xml.sax.InputSource is)
          Parse the content of the given input source as an XML document and return a new DOM Document object.
 void setDocumentClassName(java.lang.String className)
          Set the document class for the document to construct.
 void setEntityResolver(org.xml.sax.EntityResolver er)
          Specify the EntityResolver to be used to resolve entities present in the XML document to be parsed.
 void setErrorHandler(org.xml.sax.ErrorHandler eh)
          Specify the ErrorHandler to be used handle parse errors.
 void setNamespaceAware(boolean enable)
          Enable or disable namespaces.
 void setValidation(boolean enable)
          Enable or disable validation.
 java.lang.String toString()
          Generate a description of various attributes of the parser for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DOMParser

public DOMParser()
Method Detail

parse

public org.w3c.dom.Document parse(org.xml.sax.InputSource is)
                           throws org.xml.sax.SAXException,
                                  java.io.IOException
Parse the content of the given input source as an XML document and return a new DOM Document object.

Parameters:
is - InputSource containing the content to be parsed.
Throws:
java.io.IOException - If any IO errors occur.
org.xml.sax.SAXException - If any parse errors occur.
java.lang.IllegalArgumentException - If the InputSource is null
See Also:
DocumentHandler

setNamespaceAware

public void setNamespaceAware(boolean enable)
Enable or disable namespaces.


isNamespaceAware

public boolean isNamespaceAware()
Indicates whether or not this parser is configured to understand namespaces.


setValidation

public void setValidation(boolean enable)
Enable or disable validation.


isValidating

public boolean isValidating()
Indicates whether or not this parser is configured to validate XML documents.


setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver er)
Specify the EntityResolver to be used to resolve entities present in the XML document to be parsed. Setting this to null will result in the underlying implementation using it's own default implementation and behavior.


getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()
Get the EntityResolver


setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler eh)
Specify the ErrorHandler to be used handle parse errors. Setting this to null will result in the underlying implementation using it's own default implementation and behavior.


getErrorHandler

public org.xml.sax.ErrorHandler getErrorHandler()
Get the ErrorHandler.


setDocumentClassName

public void setDocumentClassName(java.lang.String className)
Set the document class for the document to construct. FIXME: need by-class object specificaion.


getDocumentClassName

public java.lang.String getDocumentClassName()
get the document class for the document to construct.


newDocument

public org.w3c.dom.Document newDocument()
Obtain a new instance of a DOM Document object to build a DOM tree with.


toString

public java.lang.String toString()
Generate a description of various attributes of the parser for debugging purposes.

Overrides:
toString in class java.lang.Object


Copyright © 2001 Enhydra.org