public final class DocumentTypeImpl extends LeafNodeImpl implements DocumentType
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.
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
DocumentTypeImpl(DocumentImpl document,
String qualifiedName,
String publicId,
String systemId) |
Modifier and Type | Method and Description |
---|---|
NamedNodeMap |
getEntities()
A
NamedNodeMap containing the general entities, both
external and internal, declared in the DTD. |
String |
getInternalSubset()
The internal subset as a string, or
null if there is none. |
String |
getName()
The name of DTD; i.e., the name immediately following the
DOCTYPE keyword. |
String |
getNodeName()
The name of this node, depending on its type; see the table above.
|
short |
getNodeType()
A code representing the type of the underlying object, as defined above.
|
NamedNodeMap |
getNotations()
A
NamedNodeMap containing the notations declared in the
DTD. |
String |
getPublicId()
The public identifier of the external subset.
|
String |
getSystemId()
The system identifier of the external subset.
|
String |
getTextContent()
This attribute returns the text content of this node and its
descendants.
|
getNextSibling, getParentNode, getPreviousSibling
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNodeValue, getOwnerDocument, getPrefix, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
public DocumentTypeImpl(DocumentImpl document, String qualifiedName, String publicId, String systemId)
public String getNodeName()
Node
getNodeName
in interface Node
getNodeName
in class NodeImpl
public short getNodeType()
Node
getNodeType
in interface Node
getNodeType
in class NodeImpl
public NamedNodeMap getEntities()
DocumentType
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.
entities
cannot be altered in any way.getEntities
in interface DocumentType
public String getInternalSubset()
DocumentType
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.
getInternalSubset
in interface DocumentType
public String getName()
DocumentType
DOCTYPE
keyword.getName
in interface DocumentType
public NamedNodeMap getNotations()
DocumentType
NamedNodeMap
containing the notations declared in the
DTD. Duplicates are discarded. Every node in this map also implements
the Notation
interface.
notations
cannot be altered in any way.getNotations
in interface DocumentType
public String getPublicId()
DocumentType
getPublicId
in interface DocumentType
public String getSystemId()
DocumentType
getSystemId
in interface DocumentType
public String getTextContent() throws DOMException
Node
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.
Text.isElementContentWhitespace
). Similarly, on setting,
no parsing is performed either, the input string is taken as pure
textual content.
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 |
getTextContent
in interface Node
getTextContent
in class NodeImpl
DOMException
- DOMSTRING_SIZE_ERR: Raised when it would return more characters than
fit in a DOMString
variable on the implementation
platform.