FileDocCategorySizeDatePackage
DOMDocumentBuilderFactory.javaAPI DocAndroid 1.5 API2885Wed May 06 22:41:06 BST 2009tests.org.w3c.dom

DOMDocumentBuilderFactory

public class DOMDocumentBuilderFactory extends Object

Fields Summary
private DocumentBuilderSetting[]
settings
Parser configuration
private DocumentBuilder
builder
private DocumentBuilderFactory
factory
Constructors Summary
public DOMDocumentBuilderFactory(DocumentBuilderSetting[] settings)


       
        if (settings == null) {
            settings = new DocumentBuilderSetting[0];
        } else {
            settings = (DocumentBuilderSetting[]) settings.clone();
        }

        factory = DocumentBuilderFactory.newInstance();
        
        if (factory == null) {
            throw new RuntimeException("DocumentBuilderFactory must not be null");
        }

        if (settings != null) {
            for (int i = 0; i < settings.length; i++) {
                settings[i].applySetting(factory);
            }
        }
        try {
            builder = factory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            e.printStackTrace();
        }
        
        if (builder == null) {
            throw new RuntimeException("DocumentBuilder must not be null");
        }
        
    
Methods Summary
public javax.xml.parsers.DocumentBuildergetBuilder()

        return builder;
    
public static DocumentBuilderSetting[]getConfiguration1()

        return new DocumentBuilderSetting[] {
                DocumentBuilderSetting.notCoalescing,
                DocumentBuilderSetting.notExpandEntityReferences,
                DocumentBuilderSetting.notIgnoringElementContentWhitespace,
                DocumentBuilderSetting.notNamespaceAware,
                DocumentBuilderSetting.notValidating };
    
public static DocumentBuilderSetting[]getConfiguration2()

        return new DocumentBuilderSetting[] {
                DocumentBuilderSetting.notCoalescing,
                DocumentBuilderSetting.notExpandEntityReferences,
                DocumentBuilderSetting.notIgnoringElementContentWhitespace,
                DocumentBuilderSetting.namespaceAware,
                DocumentBuilderSetting.notValidating };

    
public booleanhasFeature(java.lang.String feature, java.lang.String version)

        return builder.getDOMImplementation().hasFeature(feature, version);
    
public booleanisCoalescing()

        return factory.isCoalescing();
    
public booleanisExpandEntityReferences()

        return factory.isExpandEntityReferences();
    
public booleanisIgnoringElementContentWhitespace()

        return factory.isIgnoringElementContentWhitespace();
    
public booleanisNamespaceAware()

        return factory.isNamespaceAware();
    
public booleanisValidating()

        return factory.isValidating();