Class DocumentTypeImpl

All Implemented Interfaces:
DocumentType, Node

public final 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.

  • Constructor Details

  • Method Details

    • getNodeName

      public String getNodeName()
      Description copied from interface: Node
      The name of this node, depending on its type; see the table above.
      Specified by:
      getNodeName in interface Node
      Overrides:
      getNodeName in class NodeImpl
    • getNodeType

      public short getNodeType()
      Description copied from interface: Node
      A code representing the type of the underlying object, as defined above.
      Specified by:
      getNodeType in interface Node
      Specified by:
      getNodeType in class NodeImpl
    • getEntities

      public NamedNodeMap getEntities()
      Description copied from interface: DocumentType
      A NamedNodeMap containing the general entities, both external and internal, declared in the DTD. Parameter entities are not contained. Duplicates are discarded. For example in:
      <!DOCTYPE
       ex SYSTEM "ex.dtd" [ <!ENTITY foo "foo"> <!ENTITY bar
       "bar"> <!ENTITY bar "bar2"> <!ENTITY % baz "baz">
       ]> <ex/>
      the interface provides access to foo and the first declaration of bar but not the second declaration of bar or baz. Every node in this map also implements the Entity interface.
      The DOM Level 2 does not support editing entities, therefore entities cannot be altered in any way.
      Specified by:
      getEntities in interface DocumentType
    • getInternalSubset

      public String getInternalSubset()
      Description copied from interface: DocumentType
      The internal subset as a string, or null if there is none. This is does not contain the delimiting square brackets.

      Note: The actual content returned depends on how much information is available to the implementation. This may vary depending on various parameters, including the XML processor used to build the document.

      Specified by:
      getInternalSubset in interface DocumentType
    • getName

      public String getName()
      Description copied from interface: DocumentType
      The name of DTD; i.e., the name immediately following the DOCTYPE keyword.
      Specified by:
      getName in interface DocumentType
    • getNotations

      public NamedNodeMap getNotations()
      Description copied from interface: DocumentType
      A NamedNodeMap containing the notations declared in the DTD. Duplicates are discarded. Every node in this map also implements the Notation interface.
      The DOM Level 2 does not support editing notations, therefore notations cannot be altered in any way.
      Specified by:
      getNotations in interface DocumentType
    • getPublicId

      public String getPublicId()
      Description copied from interface: DocumentType
      The public identifier of the external subset.
      Specified by:
      getPublicId in interface DocumentType
    • getSystemId

      public String getSystemId()
      Description copied from interface: DocumentType
      The system identifier of the external subset. This may be an absolute URI or not.
      Specified by:
      getSystemId in interface DocumentType
    • getTextContent

      public String getTextContent() throws DOMException
      Description copied from interface: Node
      This attribute returns the text content of this node and its descendants. When it is defined to be null, setting it has no effect. On setting, any possible children this node may have are removed and, if it the new string is not empty or null, replaced by a single Text node containing the string this attribute is set to.
      On getting, no serialization is performed, the returned string does not contain any markup. No whitespace normalization is performed and the returned string does not contain the white spaces in element content (see the attribute Text.isElementContentWhitespace). Similarly, on setting, no parsing is performed either, the input string is taken as pure textual content.
      The string returned is made of the text content of this node depending on its type, as defined below:
      Node type Content
      ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, DOCUMENT_FRAGMENT_NODE concatenation of the textContent attribute value of every child node, excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the node has no children.
      TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE nodeValue
      DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE null
      Specified by:
      getTextContent in interface Node
      Overrides:
      getTextContent in class NodeImpl
      Throws:
      DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.