Java XML DocumentBuilder Create newDocumentBuilderFactory()

Here you can find the source of newDocumentBuilderFactory()

Description

new Document Builder Factory

License

Open Source License

Declaration

public static DocumentBuilderFactory newDocumentBuilderFactory() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.xml.parsers.*;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class Main {
    private static final Lock factoryLock = new ReentrantLock();

    public static DocumentBuilderFactory newDocumentBuilderFactory() {
        factoryLock.lock();/*w  w  w.  ja v  a  2  s  .c  o m*/
        try {
            return DocumentBuilderFactory.newInstance();
        } finally {
            factoryLock.unlock();
        }
    }
}

Related

  1. newDocumentBuilder(boolean ignoreWhitespace, boolean ignoreComment)
  2. newDocumentBuilder(boolean nsAware, boolean validating)
  3. newDocumentBuilder(Schema schema, boolean isNamespaceAware, boolean isXIncludeAware)
  4. newDocumentBuilderFactory()
  5. newDocumentBuilderFactory()