Java XML DocumentBuilder Create getDocumentBuilder()

Here you can find the source of getDocumentBuilder()

Description

get Document Builder

License

BSD License

Exception

Parameter Description
ParserConfigurationException if a DocumentBuildercannot be created which satisfies the configuration requested.

Return

DocumentBuilder object

Declaration

private static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException 

Method Source Code

//package com.java2s;
/*L// ww w.  j  a v a2 s  . com
 * Copyright Washington University in St. Louis, SemanticBits, Persistent Systems, Krishagni.
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/commons-module/LICENSE.txt for details.
 */

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

public class Main {
    /**
     * @return DocumentBuilder object
     * @throws ParserConfigurationException if a DocumentBuilder
      * cannot be created which satisfies the configuration requested.
     */
    private static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        return dbf.newDocumentBuilder();
    }
}

Related

  1. getDocumentBuilder()
  2. getDocumentBuilder()
  3. getDocumentBuilder()
  4. getDocumentBuilder()
  5. getDocumentBuilder()
  6. getDocumentBuilder()
  7. getDocumentBuilder()
  8. getDocumentBuilder()
  9. getDocumentBuilder()