DocumentType is an Extended DOM feature, used in XML documents but not in HTML.
Note that Entities and Notations are no longer children of the DocumentType, but are parentless nodes hung only in their appropriate NamedNodeMaps.
This area is UNDERSPECIFIED IN REC-DOM-Level-1-19981001 Most notably, absolutely no provision was made for storing and using Element and Attribute information. Nor was the linkage between Entities and Entity References nailed down solidly.
| Modifier and Type | Field and Description |
|---|---|
| private int | doctypeNumber
The following are required for compareDocumentPosition |
| protected NamedNodeMapImpl | elements
Elements. |
| protected NamedNodeMapImpl | entities
Entities. |
| protected String | |
| protected String | name
Document type name. |
| protected NamedNodeMapImpl | notations
Notations. |
| protected String | |
| pack-priv static final long | serialVersionUID
Serialization version.
|
| protected String | |
| private Hashtable |
| Access | Constructor and Description |
|---|---|
| public | DocumentTypeImpl(CoreDocumentImpl ownerDocument, String name)
Factory method for creating a document type node. |
| public | DocumentTypeImpl(CoreDocumentImpl ownerDocument, String qualifiedName, String publicID, String systemID)
Factory method for creating a document type node. |
| Modifier and Type | Method and Description |
|---|---|
| public Node | cloneNode(boolean
If deep)true, recursively clone the subtree under
the specified node; if false, clone only the node
itself (and its attributes, if it is an Element).Overrides org. Implements org. |
| public NamedNodeMap | |
| public NamedNodeMap | getEntities()
Implements org. |
| public String | getInternalSubset()
Implements org. |
| public String | |
| public String | getNodeName()
Implements abstract org. Implements org. |
| protected int | getNodeNumber()
Overrides org. |
| public short | getNodeType()
Implements abstract org. Implements org. |
| public NamedNodeMap | getNotations()
Implements org. |
| public String | |
| public String | |
| public String | getTextContent()
Overrides org. Implements org. |
| public Object | getUserData(String
The key the object is associated to. key)Overrides org. Implements org. |
| protected Hashtable | |
| public boolean | isEqualNode(Node
The node to compare equality with. arg)Overrides org. Implements org. |
| public void | |
| protected void | setOwnerDocument(CoreDocumentImpl doc)
Overrides org. |
| public void | setReadOnly(boolean
True or false as desired. readOnly, boolean If true, children are also toggled. Note that this will
not change the state of an EntityReference or its children,
which are always read-only. deep)Overrides org. |
| public void | setTextContent(String textContent)
Overrides org. Implements org. |
| public Object | setUserData(String
The key to associate the object to. key, Object The object to associate to the given key, or
data, UserDataHandler null to remove any existing association to that key.The handler to associate to that key, or
handler)null.Overrides org. Implements org. |
| doctypeNumber | back to summary |
|---|---|
| private int doctypeNumber The following are required for compareDocumentPosition | |
| elements | back to summary |
|---|---|
| protected NamedNodeMapImpl elements Elements. | |
| entities | back to summary |
|---|---|
| protected NamedNodeMapImpl entities Entities. | |
| internalSubset | back to summary |
|---|---|
| protected String internalSubset | |
| name | back to summary |
|---|---|
| protected String name Document type name. | |
| notations | back to summary |
|---|---|
| protected NamedNodeMapImpl notations Notations. | |
| publicID | back to summary |
|---|---|
| protected String publicID | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID Hides org. Serialization version. | |
| systemID | back to summary |
|---|---|
| protected String systemID | |
| userData | back to summary |
|---|---|
| private Hashtable<K, V> userData | |
| DocumentTypeImpl | back to summary |
|---|---|
| public DocumentTypeImpl(CoreDocumentImpl ownerDocument, String name) Factory method for creating a document type node. | |
| DocumentTypeImpl | back to summary |
|---|---|
| public DocumentTypeImpl(CoreDocumentImpl ownerDocument, String qualifiedName, String publicID, String systemID) Factory method for creating a document type node. | |
| cloneNode | back to summary |
|---|---|
| public Node cloneNode(boolean deep) Overrides org. Implements org. Clones the node.
| |
| getElements | back to summary |
|---|---|
| public NamedNodeMap getElements() NON-DOM: Access the collection of ElementDefinitions.
| |
| getEntities | back to summary |
|---|---|
| public NamedNodeMap getEntities() Implements org. Access the collection of general Entities, both external and internal, defined in the DTD. For example, in:
<!doctype example SYSTEM "ex.dtd" [
<!ENTITY foo "foo">
<!ENTITY bar "bar">
<!ENTITY % baz "baz">
]>
The Entities map includes foo and bar, but not baz. It is promised that only Nodes which are Entities will exist in this NamedNodeMap. For HTML, this will always be null. Note that "built in" entities such as & and < should be converted to their actual characters before being placed in the DOM's contained text, and should be converted back when the DOM is rendered as XML or HTML, and hence DO NOT appear here. | |
| getInternalSubset | back to summary |
|---|---|
| public String getInternalSubset() Implements org. Introduced in DOM Level 2. Return the internalSubset given as a string.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements org. Name of this document type. If we loaded from a DTD, this should be the name immediately following the DOCTYPE keyword. | |
| getNodeName | back to summary |
|---|---|
| public String getNodeName() Implements abstract org. Implements org. Returns the document type name | |
| getNodeNumber | back to summary |
|---|---|
| protected int getNodeNumber() Overrides org. NON-DOM Get the number associated with this doctype. | |
| getNodeType | back to summary |
|---|---|
| public short getNodeType() Implements abstract org. Implements org. A short integer indicating what type of node this is. The named constants for this value are defined in the org.w3c.dom.Node interface. | |
| getNotations | back to summary |
|---|---|
| public NamedNodeMap getNotations() Implements org. Access the collection of Notations defined in the DTD. A notation declares, by name, the format of an XML unparsed entity or is used to formally declare a Processing Instruction target. | |
| getPublicId | back to summary |
|---|---|
| public String getPublicId() Implements org. Introduced in DOM Level 2. Return the public identifier of this Document type.
| |
| getSystemId | back to summary |
|---|---|
| public String getSystemId() Implements org. Introduced in DOM Level 2. Return the system identifier of this Document type.
| |
| getTextContent | back to summary | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| public String getTextContent() throws DOMException Overrides org. Implements org. Doc from org. This attribute returns the text content of this node and its
descendants. When it is defined to be
| |||||||||
| getUserData | back to summary |
|---|---|
| public Object getUserData(String key) Overrides org. Implements org. Doc from org. Retrieves the object associated to a key on a this node. The object
must first have been set to this node by calling
| |
| getUserDataRecord | back to summary |
|---|---|
| protected Hashtable | |
| isEqualNode | back to summary |
|---|---|
| public boolean isEqualNode(Node arg) Overrides org. Implements org. DOM Level 3 WD- Experimental. Override inherited behavior from ParentNodeImpl to support deep equal.
| |
| setInternalSubset | back to summary |
|---|---|
| public void setInternalSubset(String internalSubset) NON-DOM. Set the internalSubset given as a string. | |
| setOwnerDocument | back to summary |
|---|---|
| protected void setOwnerDocument(CoreDocumentImpl doc) Overrides org. NON-DOM set the ownerDocument of this node and its children | |
| setReadOnly | back to summary |
|---|---|
| public void setReadOnly(boolean readOnly, boolean deep) Overrides org. NON-DOM: Subclassed to flip the entities' and notations' readonly switch as well.
| |
| setTextContent | back to summary | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| public void setTextContent(String textContent) throws DOMException Overrides org. Implements org. Doc from org. This attribute returns the text content of this node and its
descendants. When it is defined to be
| |||||||||
| setUserData | back to summary |
|---|---|
| public Object setUserData(String key, Object data, UserDataHandler handler) Overrides org. Implements org. Doc from org. Associate an object to a key on this node. The object can later be
retrieved from this node by calling
| |