Here you can find the source of getDocumentBuilderFactory()
public static synchronized DocumentBuilderFactory getDocumentBuilderFactory()
//package com.java2s; import javax.xml.parsers.DocumentBuilderFactory; public class Main { /** Reusable document builder factory. */ private static DocumentBuilderFactory documentBuilderFactory; /**//from ww w .j av a 2s . co m * Gets the document builder factory, creating it if necessary. * * @return the document builder factory. */ public static synchronized DocumentBuilderFactory getDocumentBuilderFactory() { if (documentBuilderFactory == null) { documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setExpandEntityReferences(false); } return documentBuilderFactory; } }