Enhydra 3.1b2 API

org.enhydra.xml.io
Class DOMParser

java.lang.Object
  |
  +--org.enhydra.xml.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:

See Also:
DocumentBuilder

Constructor Summary
DOMParser()
           
 
Method Summary
 java.lang.String getDocumentClassName()
          get the document class for the document to construct.
 EntityResolver getEntityResolver()
          Get the EntityResolver
 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.
 Document newDocument()
          Obtain a new instance of a DOM Document object to build a DOM tree with.
 Document parse(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(EntityResolver er)
          Specify the EntityResolver to be used to resolve entities present in the XML document to be parsed.
 void setErrorHandler(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 Document parse(InputSource is)
               throws 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.
SAXException - If any parse errors occur.
java.lang.IllegalArgumentException - If the InputSource is null
See Also:
DocumentHandler, javax.xml.parsers.DocumentBuilder.parse

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.
See Also:
javax.xml.parsers.DocumentBuilder.isNamespaceAware

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.
See Also:
javax.xml.parsers.DocumentBuilder.isValidating

setEntityResolver

public void setEntityResolver(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.
See Also:
javax.xml.parsers.DocumentBuilder.setEntityResolver

getEntityResolver

public EntityResolver getEntityResolver()
Get the EntityResolver

setErrorHandler

public void setErrorHandler(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.
See Also:
javax.xml.parsers.DocumentBuilder.setErrorHandler

getErrorHandler

public 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 Document newDocument()
Obtain a new instance of a DOM Document object to build a DOM tree with.
See Also:
javax.xml.parsers.DocumentBuilder.newDocument

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

Enhydra 3.1b2 API