org.enhydra.xml.io
Class DOMParser

java.lang.Object
  |
  +--javax.xml.parsers.DocumentBuilder
        |
        +--org.enhydra.xml.io.DOMParser

public class DOMParser
extends DocumentBuilder

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

See Also:
DocumentBuilder

Inner Class Summary
(package private)  class DOMParser.XercesParser
          Need standarderror handler, this is just a tmp hack.
 
Constructor Summary
DOMParser()
           
 
Method Summary
 String getDocumentClassName()
          get the document class for the document to construct.
 DOMImplementation getDOMImplementation()
          Obtain an instance of a DOMImplementation object.
 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(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.
 String toString()
          Generate a description of various attributes of the parser for debugging purposes.
 
Methods inherited from class javax.xml.parsers.DocumentBuilder
getSchema, isXIncludeAware, parse, parse, parse, parse, reset
 
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,
                      IOException
Parse the content of the given input source as an XML document and return a new DOM Document object.
Overrides:
parse in class DocumentBuilder
Parameters:
is - InputSource containing the content to be parsed.
Throws:
IOException - If any IO errors occur.
SAXException - If any parse errors occur.
IllegalArgumentException - If the InputSource is null
See Also:
DocumentBuilder.parse(java.io.InputStream)

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.
Overrides:
isNamespaceAware in class DocumentBuilder
See Also:
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.
Overrides:
isValidating in class DocumentBuilder
See Also:
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.
Overrides:
setEntityResolver in class DocumentBuilder
See Also:
DocumentBuilder.setEntityResolver(org.xml.sax.EntityResolver)

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.
Overrides:
setErrorHandler in class DocumentBuilder
See Also:
DocumentBuilder.setErrorHandler(org.xml.sax.ErrorHandler)

getErrorHandler

public ErrorHandler getErrorHandler()
Get the ErrorHandler.

setDocumentClassName

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

getDocumentClassName

public 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.
Overrides:
newDocument in class DocumentBuilder
See Also:
DocumentBuilder.newDocument()

getDOMImplementation

public DOMImplementation getDOMImplementation()
Obtain an instance of a DOMImplementation object.
Overrides:
getDOMImplementation in class DocumentBuilder
Returns:
A new instance of a DOMImplementation.

toString

public String toString()
Generate a description of various attributes of the parser for debugging purposes.
Overrides:
toString in class Object


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.