Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.xml.io
Class DOMParser  view DOMParser download DOMParser.java

java.lang.Object
  extended byorg.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:


Nested Class Summary
(package private)  class DOMParser.XercesParser
          Need standarderror handler, this is just a tmp hack.
 
Field Summary
private  java.lang.String documentClassName
          Class name to use for the Document object.
private  boolean enableNamespaces
          Namespaces enabled.
private  org.xml.sax.EntityResolver entityResolver
          Entity resolver.
private  org.xml.sax.ErrorHandler errorHandler
          Error handler.
private  boolean validationEnabled
          Validation enabled.
 
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
 

Field Detail

documentClassName

private java.lang.String documentClassName
Class name to use for the Document object.


errorHandler

private org.xml.sax.ErrorHandler errorHandler
Error handler.


entityResolver

private org.xml.sax.EntityResolver entityResolver
Entity resolver.


enableNamespaces

private boolean enableNamespaces
Namespaces enabled.


validationEnabled

private boolean validationEnabled
Validation enabled.

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.


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.