FileDocCategorySizeDatePackage
DocumentTypeImpl.javaAPI DocAndroid 1.5 API3445Wed May 06 22:41:06 BST 2009org.apache.harmony.xml.dom

DocumentTypeImpl

public class DocumentTypeImpl extends LeafNodeImpl implements DocumentType
Provides a straightforward implementation of the corresponding W3C DOM interface. The class is used internally only, thus only notable members that are not in the original interface are documented (the W3C docs are quite extensive). Hope that's ok.

Some of the fields may have package visibility, so other classes belonging to the DOM implementation can easily access them while maintaining the DOM tree structure.

Fields Summary
private String
qualifiedName
private String
publicId
private String
systemId
Constructors Summary
DocumentTypeImpl(DOMImplementationImpl impl, String qualifiedName, String publicId, String systemId)

        super(null);

        if (qualifiedName == null || "".equals(qualifiedName)) {
            throw new DOMException(DOMException.NAMESPACE_ERR, qualifiedName);
        }
        
        int prefixSeparator = qualifiedName.lastIndexOf(":");
        if (prefixSeparator != -1) {
            String prefix = qualifiedName.substring(0, prefixSeparator);
            String localName = qualifiedName.substring(prefixSeparator + 1);
            
            if (!DocumentImpl.isXMLIdentifier(prefix)) {
                throw new DOMException(DOMException.NAMESPACE_ERR, qualifiedName);
            }

            if (!DocumentImpl.isXMLIdentifier(localName)) {
                throw new DOMException(DOMException.INVALID_CHARACTER_ERR, qualifiedName);
            }
        } else {
            if (!DocumentImpl.isXMLIdentifier(qualifiedName)) {
                throw new DOMException(DOMException.INVALID_CHARACTER_ERR, qualifiedName);
            }
        }
        
        this.qualifiedName = qualifiedName;
        this.publicId = publicId;
        this.systemId = systemId;
    
Methods Summary
public org.w3c.dom.NamedNodeMapgetEntities()

        // TODO Dummy. Implement this later, if at all (we're DOM level 2 only).
        return null;
    
public java.lang.StringgetInternalSubset()

        // TODO Dummy. Implement this later, if at all (we're DOM level 2 only).
        return null;
    
public java.lang.StringgetName()

        return qualifiedName;
    
public java.lang.StringgetNodeName()

        return qualifiedName;
    
public shortgetNodeType()

        return Node.DOCUMENT_TYPE_NODE;
    
public org.w3c.dom.NamedNodeMapgetNotations()

        // TODO Dummy. Implement this later, if at all (we're DOM level 2 only).
        return null;
    
public java.lang.StringgetPublicId()

        return publicId;
    
public java.lang.StringgetSystemId()

        return systemId;