org.apache.xerces.jaxp

## Class DocumentBuilderImpl

- java.lang.Object
- - javax.xml.parsers.DocumentBuilder
  - - org.apache.xerces.jaxp.DocumentBuilderImpl

All Implemented Interfaces:
  JAXPConstants

    public class DocumentBuilderImpl
    extends javax.xml.parsers.DocumentBuilder
    implements JAXPConstants

Version:
  $Id: DocumentBuilderImpl.java 704573 2008-10-14 16:11:22Z mrglavas $
Author:
  Rajiv Mordani, Edwin Goei

### Field Summary

### Fields inherited from interface org.apache.xerces.jaxp.JAXPConstants

`JAXP_SCHEMA_LANGUAGE, JAXP_SCHEMA_SOURCE, W3C_XML_SCHEMA`

### Method Summary

All Methods Instance Methods Concrete Methods
`org.w3c.dom.DOMImplementation` `getDOMImplementation()` Obtain an instance of a `DOMImplementation` object.
`javax.xml.validation.Schema` `getSchema()` Get a reference to the the `Schema` being used by the XML processor.
`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.
`boolean` `isXIncludeAware()` Gets the XInclude processing mode for this parser
`org.w3c.dom.Document` `newDocument()` Non-preferred: use the getDOMImplementation() method instead of this one to get a DOM Level 2 DOMImplementation object and then use DOM Level 2 methods to create a DOM Document object.
`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` `reset()` Reset this `DocumentBuilder` to its original configuration.
`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 by the parser.

### Methods inherited from class javax.xml.parsers.DocumentBuilder

`parse, parse, parse, parse`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### newDocument

    public org.w3c.dom.Document newDocument()

Non-preferred: use the getDOMImplementation() method instead of this one to get a DOM Level 2 DOMImplementation object and then use DOM Level 2 methods to create a DOM Document object.

Specified by:
  `newDocument` in class `javax.xml.parsers.DocumentBuilder`
Returns:
  A new instance of a DOM Document object.

#### getDOMImplementation

    public org.w3c.dom.DOMImplementation getDOMImplementation()

Description copied from class: `javax.xml.parsers.DocumentBuilder`
Obtain an instance of a `DOMImplementation` object.

Specified by:
  `getDOMImplementation` in class `javax.xml.parsers.DocumentBuilder`
Returns:
  A new instance of a `DOMImplementation`.

#### parse

    public org.w3c.dom.Document parse(org.xml.sax.InputSource is)
                               throws org.xml.sax.SAXException,
                                      java.io.IOException

Description copied from class: `javax.xml.parsers.DocumentBuilder`
Parse the content of the given input source as an XML document and return a new DOM `Document` object. An `IllegalArgumentException` is thrown if the `InputSource` is `null` null.

Specified by:
  `parse` in class `javax.xml.parsers.DocumentBuilder`
Parameters:
  `is` - InputSource containing the content to be parsed.
Returns:
  A new DOM Document object.
Throws:
  `org.xml.sax.SAXException` - If any parse errors occur.
  `java.io.IOException` - If any IO errors occur.
See Also:
  `DocumentHandler`

#### isNamespaceAware

    public boolean isNamespaceAware()

Description copied from class: `javax.xml.parsers.DocumentBuilder`
Indicates whether or not this parser is configured to understand namespaces.

Specified by:
  `isNamespaceAware` in class `javax.xml.parsers.DocumentBuilder`
Returns:
  true if this parser is configured to understand namespaces; false otherwise.

#### isValidating

    public boolean isValidating()

Description copied from class: `javax.xml.parsers.DocumentBuilder`
Indicates whether or not this parser is configured to validate XML documents.

Specified by:
  `isValidating` in class `javax.xml.parsers.DocumentBuilder`
Returns:
  true if this parser is configured to validate XML documents; false otherwise.

#### isXIncludeAware

    public boolean isXIncludeAware()

Gets the XInclude processing mode for this parser

Overrides:
  `isXIncludeAware` in class `javax.xml.parsers.DocumentBuilder`
Returns:
  the state of XInclude processing mode
See Also:
  `DocumentBuilderFactory.setXIncludeAware(boolean)`

#### setEntityResolver

    public void setEntityResolver(org.xml.sax.EntityResolver er)

Description copied from class: `javax.xml.parsers.DocumentBuilder`
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.

Specified by:
  `setEntityResolver` in class `javax.xml.parsers.DocumentBuilder`
Parameters:
  `er` - The `EntityResolver` to be used to resolve entities present in the XML document to be parsed.

#### setErrorHandler

    public void setErrorHandler(org.xml.sax.ErrorHandler eh)

Description copied from class: `javax.xml.parsers.DocumentBuilder`
Specify the `ErrorHandler` to be used by the parser. Setting this to `null` will result in the underlying implementation using it's own default implementation and behavior.

Specified by:
  `setErrorHandler` in class `javax.xml.parsers.DocumentBuilder`
Parameters:
  `eh` - The `ErrorHandler` to be used by the parser.

#### getSchema

    public javax.xml.validation.Schema getSchema()

Description copied from class: `javax.xml.parsers.DocumentBuilder`

Get a reference to the the `Schema` being used by the XML processor.

If no schema is being used, `null` is returned.

Overrides:
  `getSchema` in class `javax.xml.parsers.DocumentBuilder`
Returns:
  `Schema` being used or `null` if none in use

#### reset

    public void reset()

Description copied from class: `javax.xml.parsers.DocumentBuilder`

Reset this `DocumentBuilder` to its original configuration.

`DocumentBuilder` is reset to the same state as when it was created with `DocumentBuilderFactory.newDocumentBuilder()`. `reset()` is designed to allow the reuse of existing `DocumentBuilder`s thus saving resources associated with the creation of new `DocumentBuilder`s.

The reset `DocumentBuilder` is not guaranteed to have the same `EntityResolver` or `ErrorHandler` `Object`s, e.g. `Object.equals(Object obj)`. It is guaranteed to have a functionally equal `EntityResolver` and `ErrorHandler`.

Overrides:
  `reset` in class `javax.xml.parsers.DocumentBuilder`