javax.xml.parsers
Class DocumentBuilder

java.lang.Object
  |
  +--javax.xml.parsers.DocumentBuilder

public abstract class DocumentBuilder
extends java.lang.Object

Parser to create a DOM Document from an input source

 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
 DocumentBuilder parser = factory.newDocumentBuilder();
 Document doc = parser.parse(myInputSource);
 


Constructor Summary
DocumentBuilder()
           
 
Method Summary
abstract  boolean isNamespaceAware()
          Returns true if the parser is namespace-aware
abstract  boolean isValidating()
          Returns true if the parser is validating
abstract  Document newDocument()
          Returns a new Document
 Document parse(java.io.File file)
          Parse given a File
abstract  Document parse(InputSource source)
          Parse given an input source
 Document parse(java.io.InputStream stream)
          Parse the given input stream
 Document parse(java.lang.String uri)
          Parse given a path name
abstract  void setEntityResolver(EntityResolver er)
          Sets the entity resolver
abstract  void setErrorHandler(ErrorHandler eh)
          Sets the error handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentBuilder

public DocumentBuilder()
Method Detail

parse

public Document parse(java.io.InputStream stream)
               throws SAXException,
                      java.io.IOException
Parse the given input stream
Parameters:
stream - the input stream to be used as a source

parse

public Document parse(java.lang.String uri)
               throws SAXException,
                      java.io.IOException
Parse given a path name
Parameters:
uri - a path to the file to open

parse

public Document parse(java.io.File file)
               throws SAXException,
                      java.io.IOException
Parse given a File
Parameters:
file - a path to the file to open

parse

public abstract Document parse(InputSource source)
                        throws SAXException,
                               java.io.IOException
Parse given an input source
Parameters:
source - a SAX input source

isNamespaceAware

public abstract boolean isNamespaceAware()
Returns true if the parser is namespace-aware

isValidating

public abstract boolean isValidating()
Returns true if the parser is validating

setEntityResolver

public abstract void setEntityResolver(EntityResolver er)
Sets the entity resolver

setErrorHandler

public abstract void setErrorHandler(ErrorHandler eh)
Sets the error handler

newDocument

public abstract Document newDocument()
Returns a new Document