Java Utililty Methods XML DocumentBuilder Create

List of utility methods to do XML DocumentBuilder Create

Description

The list of methods to do XML DocumentBuilder Create are organized into topic(s).

Method

DocumentBuildernewDocumentBuilder()
Creates and returns a new DocumentBuilder .
return _dbf.newDocumentBuilder();
DocumentBuildernewDocumentBuilder(Boolean disallowDoctypeDecl)
new Document Builder
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setValidating(false);
dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
boolean isDissalowDoctypeDecl = disallowDoctypeDecl == null ? true : disallowDoctypeDecl;
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", isDissalowDoctypeDecl);
dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
...
DocumentBuildernewDocumentBuilder(boolean ignoreWhitespace, boolean ignoreComment)
new Document Builder
try {
    DocumentBuilderFactory dbf = createDefaultDocumentBuilderFactory();
    dbf.setIgnoringElementContentWhitespace(ignoreWhitespace);
    dbf.setIgnoringComments(ignoreComment);
    return dbf.newDocumentBuilder();
} catch (ParserConfigurationException e) {
    e.printStackTrace();
    throw new IllegalStateException(e);
...
DocumentBuildernewDocumentBuilder(boolean nsAware, boolean validating)
new Document Builder
return newDocumentBuilder(nsAware, validating, false, false);
DocumentBuildernewDocumentBuilder(Schema schema, boolean isNamespaceAware, boolean isXIncludeAware)
new Document Builder
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(isNamespaceAware);
factory.setXIncludeAware(isXIncludeAware);
if (schema != null) {
    factory.setSchema(schema);
    factory.setValidating(false);
DocumentBuilder builder = null;
...
DocumentBuilderFactorynewDocumentBuilderFactory()
Instantiate a new DocumentBuilderFactory.
DocumentBuilderFactory piTmp0 = null;
piTmp0 = AccessController.doPrivileged(new PrivilegedAction<DocumentBuilderFactory>() {
    public DocumentBuilderFactory run() {
        return DocumentBuilderFactory.newInstance();
});
return piTmp0;
DocumentBuilderFactorynewDocumentBuilderFactory()
new Document Builder Factory
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
return dbf;
DocumentBuilderFactorynewDocumentBuilderFactory()
new Document Builder Factory
factoryLock.lock();
try {
    return DocumentBuilderFactory.newInstance();
} finally {
    factoryLock.unlock();