Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.xml.parsers
Class DocumentBuilderFactory

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

public abstract class DocumentBuilderFactory
extends java.lang.Object

The `DocumentBuilderFactory` defines a factory API that enables applications to configure and obtain a parser to parse XML documents into a DOM Document tree.
ATTENTION: THIS IMPLEMENTATION OF THE "JAVAX.XML.PARSER" CLASSES IS NOT THE OFFICIAL REFERENCE IMPLEMENTATION OF THE JAVA SPECIFICATION REQUEST 5 FOUND AT http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING" SPECIFICATION VERSION 1.0 PUBLIC RELEASE 1 BY JAMES DUNCAN DAVIDSON PUBLISHED BY SUN MICROSYSTEMS ON FEB. 18, 2000 AND FOUND AT http://java.sun.com/xml
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Method Summary
`boolean` | `isNamespaceAware()` Indicates if this `DocumentBuilderFactory` is configured to produce parsers that are namespace aware or not.
`boolean` | `isValidating()` Indicates if this `DocumentBuilderFactory` is configured to produce parsers that validate XML documents as they are parsed.
`abstract DocumentBuilder` | `newDocumentBuilder()` Returns a new configured instance of type `DocumentBuilder`.
`static DocumentBuilderFactory` | `newInstance()` Returns a new instance of a `DocumentBuilderFactory`.
`void` | `setNamespaceAware(boolean aware)` Configuration method that specifies whether the parsers created by this factory are required to provide XML namespace support or not.
`void` | `setValidating(boolean validating)` Configuration method whether specifies if the parsers created by this factory are required to validate the XML documents that they parse.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### newInstance

    public static DocumentBuilderFactory newInstance()

  Returns a new instance of a `DocumentBuilderFactory`.
  The implementation of the `DocumentBuilderFactory` returned depends on the setting of the `javax.xml.parsers.DocumentBuilderFactory` property or, if the property is not set, a platform specific default.
  Throws:
    FactoryConfigurationError - If the class implementing the factory cannot be found or instantiated. An `Error` is thrown instead of an exception because the application is not expected to handle or recover from such events.

### newDocumentBuilder

    public abstract DocumentBuilder newDocumentBuilder()
                                                throws ParserConfigurationException

  Returns a new configured instance of type `DocumentBuilder`.
  Throws:
    ParserConfigurationException - If the `DocumentBuilder` instance cannot be created with the requested configuration.

### setNamespaceAware

    public void setNamespaceAware(boolean aware)

  Configuration method that specifies whether the parsers created by this factory are required to provide XML namespace support or not.
  NOTE: if a parser cannot be created by this factory that satisfies the requested namespace awareness value, a `ParserConfigurationException` will be thrown when the program attempts to aquire the parser calling the `newDocumentBuilder()` method.

### setValidating

    public void setValidating(boolean validating)

  Configuration method whether specifies if the parsers created by this factory are required to validate the XML documents that they parse.
  NOTE: if a parser cannot be created by this factory that satisfies the requested validation capacity, a `ParserConfigurationException` will be thrown when the application attempts to aquire the parser via the `newDocumentBuilder()` method.

### isNamespaceAware

    public boolean isNamespaceAware()

  Indicates if this `DocumentBuilderFactory` is configured to produce parsers that are namespace aware or not.

### isValidating

    public boolean isValidating()

  Indicates if this `DocumentBuilderFactory` is configured to produce parsers that validate XML documents as they are parsed.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache XML Project. All Rights Reserved.