Java XML DocumentBuilder Create newDocumentBuilder()

Here you can find the source of newDocumentBuilder()

Description

Creates and returns a new DocumentBuilder .

License

Apache License

Exception

Parameter Description
ParserConfigurationException if the creation fails

Return

a new

Declaration

public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    private static DocumentBuilderFactory _dbf = DocumentBuilderFactory.newInstance();

    /**/*ww w.j  av a 2  s.  co m*/
     * Creates and returns a new {@link DocumentBuilder}.
     * 
     * @return a new {@link DocumentBuilder}
     * @throws ParserConfigurationException
     *            if the creation fails
     */
    public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException {
        return _dbf.newDocumentBuilder();
    }
}

Related

  1. newDocumentBuilder()
  2. newDocumentBuilder()
  3. newDocumentBuilder()
  4. newDocumentBuilder()
  5. newDocumentBuilder()
  6. newDocumentBuilder(Boolean disallowDoctypeDecl)
  7. newDocumentBuilder(boolean ignoreWhitespace, boolean ignoreComment)
  8. newDocumentBuilder(boolean nsAware, boolean validating)
  9. newDocumentBuilder(Schema schema, boolean isNamespaceAware, boolean isXIncludeAware)