FileDocCategorySizeDatePackage
DocumentBuilderFactoryImpl.javaAPI DocAndroid 1.5 API3612Wed May 06 22:41:06 BST 2009org.apache.harmony.xml.parsers

DocumentBuilderFactoryImpl

public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory
Provides a straightforward DocumentBuilderFactory implementation based on XMLPull/KXML. The class is used internally only, thus only notable members that are not already in the abstract superclass are documented. Hope that's ok.

Fields Summary
private static final String
NAMESPACES
private static final String
VALIDATION
Constructors Summary
Methods Summary
public java.lang.ObjectgetAttribute(java.lang.String name)

    
    
          
        throw new IllegalArgumentException(name);
    
public booleangetFeature(java.lang.String name)

        if (name == null) {
            throw new NullPointerException();
        }
        
        if (NAMESPACES.equals(name)) {
            return isNamespaceAware();
        } else if (VALIDATION.equals(name)) {
            return isValidating();
        } else {
            throw new ParserConfigurationException(name);
        }
    
public javax.xml.parsers.DocumentBuildernewDocumentBuilder()

        if (isValidating()) {
            throw new ParserConfigurationException(
                    "No validating DocumentBuilder implementation available");
        }
        
        /**
         * TODO If Android is going to support a different DocumentBuilder
         * implementations, this should be wired here. If we wanted to
         * allow different implementations, these could be distinguished by
         * a special feature (like http://www.org.apache.harmony.com/xml/expat)
         * or by throwing the full SPI monty at it.  
         */
        DocumentBuilderImpl builder = new DocumentBuilderImpl();
        
        builder.setIgnoreComments(isIgnoringComments());
        builder.setIgnoreElementContentWhitespace(
                isIgnoringElementContentWhitespace());
        builder.setNamespaceAware(isNamespaceAware());

        // TODO What about expandEntityReferences?
        
        return builder;
    
public voidsetAttribute(java.lang.String name, java.lang.Object value)

        throw new IllegalArgumentException(name);
    
public voidsetFeature(java.lang.String name, boolean value)

        if (name == null) {
            throw new NullPointerException();
        }

        if (NAMESPACES.equals(name)) {
            setNamespaceAware(value);
        } else if (VALIDATION.equals(name)) {
            setValidating(value);
        } else {
            throw new ParserConfigurationException(name);
        }