Java XML DocumentBuilder Create newDocumentBuilderFactory()

Here you can find the source of newDocumentBuilderFactory()

Description

Instantiate a new DocumentBuilderFactory.

License

Open Source License

Declaration

public static DocumentBuilderFactory newDocumentBuilderFactory() 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2008 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from www.  j  av  a2 s  .  co  m
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

import java.security.AccessController;
import java.security.PrivilegedAction;

import javax.xml.parsers.DocumentBuilderFactory;

public class Main {
    /**
     * Instantiate a new DocumentBuilderFactory.
     * 
     * @return
     */
    public static DocumentBuilderFactory newDocumentBuilderFactory() {

        DocumentBuilderFactory piTmp0 = null;
        piTmp0 = AccessController.doPrivileged(new PrivilegedAction<DocumentBuilderFactory>() {

            public DocumentBuilderFactory run() {
                return DocumentBuilderFactory.newInstance();
            }
        });

        return piTmp0;
    }
}

Related

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