|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.dom.NodeImpl | +--org.apache.xerces.dom.ChildNode | +--org.apache.xerces.dom.ParentNode | +--org.apache.xerces.dom.DocumentTypeImpl
This class represents a Document Type declaraction in the document itself, not a Document Type Definition (DTD). An XML document may (or may not) have such a reference.
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.
Field Summary | |
---|---|
protected NamedNodeMapImpl |
elements
Elements. |
protected NamedNodeMapImpl |
entities
Entities. |
protected java.lang.String |
internalSubset
|
protected java.lang.String |
name
Document type name. |
protected NamedNodeMapImpl |
notations
Notations. |
protected java.lang.String |
publicID
|
protected java.lang.String |
systemID
|
Fields inherited from class org.apache.xerces.dom.ParentNode |
---|
firstChild, fNodeListCache, ownerDocument |
Fields inherited from class org.apache.xerces.dom.ChildNode |
---|
nextSibling, previousSibling |
Fields inherited from interface org.w3c.dom.Node |
---|
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 Summary | |
---|---|
DocumentTypeImpl(CoreDocumentImpl ownerDocument,
java.lang.String name)
Factory method for creating a document type node. |
|
DocumentTypeImpl(CoreDocumentImpl ownerDocument,
java.lang.String qualifiedName,
java.lang.String publicID,
java.lang.String systemID)
Factory method for creating a document type node. |
Method Summary | |
---|---|
org.w3c.dom.Node |
cloneNode(boolean deep)
Clones the node. |
org.w3c.dom.NamedNodeMap |
getElements()
NON-DOM: Access the collection of ElementDefinitions. |
org.w3c.dom.NamedNodeMap |
getEntities()
Access the collection of general Entities, both external and internal, defined in the DTD. |
java.lang.String |
getInternalSubset()
Introduced in DOM Level 2. |
java.lang.String |
getName()
Name of this document type. |
java.lang.String |
getNodeName()
Returns the document type name |
protected int |
getNodeNumber()
NON-DOM Get the number associated with this doctype. |
short |
getNodeType()
A short integer indicating what type of node this is. |
org.w3c.dom.NamedNodeMap |
getNotations()
Access the collection of Notations defined in the DTD. |
java.lang.String |
getPublicId()
Introduced in DOM Level 2. |
java.lang.String |
getSystemId()
Introduced in DOM Level 2. |
java.lang.String |
getTextContent()
This attribute returns the text content of this node and its descendants. |
java.lang.Object |
getUserData(java.lang.String key)
Retrieves the object associated to a key on a this node. |
protected java.util.Hashtable |
getUserDataRecord()
|
boolean |
isEqualNode(org.w3c.dom.Node arg)
DOM Level 3 WD- Experimental. |
void |
setInternalSubset(java.lang.String internalSubset)
NON-DOM. |
protected void |
setOwnerDocument(CoreDocumentImpl doc)
NON-DOM set the ownerDocument of this node and its children |
void |
setReadOnly(boolean readOnly,
boolean deep)
NON-DOM: Subclassed to flip the entities' and notations' readonly switch as well. |
void |
setTextContent(java.lang.String textContent)
This attribute returns the text content of this node and its descendants. |
java.lang.Object |
setUserData(java.lang.String key,
java.lang.Object data,
org.w3c.dom.UserDataHandler handler)
Associate an object to a key on this node. |
Methods inherited from class org.apache.xerces.dom.ParentNode |
---|
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, hasChildNodes, insertBefore, item, normalize, removeChild, replaceChild, synchronizeChildren |
Methods inherited from class org.apache.xerces.dom.ChildNode |
---|
getNextSibling, getParentNode, getPreviousSibling |
Methods inherited from class org.apache.xerces.dom.NodeImpl |
---|
addEventListener, appendChild, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getBaseURI, getContainer, getFeature, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, hasAttributes, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setPrefix, setUserData, synchronizeData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
---|
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
Field Detail |
protected java.lang.String name
protected NamedNodeMapImpl entities
protected NamedNodeMapImpl notations
protected NamedNodeMapImpl elements
protected java.lang.String publicID
protected java.lang.String systemID
protected java.lang.String internalSubset
Constructor Detail |
public DocumentTypeImpl(CoreDocumentImpl ownerDocument, java.lang.String name)
public DocumentTypeImpl(CoreDocumentImpl ownerDocument, java.lang.String qualifiedName, java.lang.String publicID, java.lang.String systemID)
Method Detail |
public java.lang.String getPublicId()
Return the public identifier of this Document type.
getPublicId
in interface org.w3c.dom.DocumentType
public java.lang.String getSystemId()
Return the system identifier of this Document type.
getSystemId
in interface org.w3c.dom.DocumentType
public void setInternalSubset(java.lang.String internalSubset)
Set the internalSubset given as a string.
public java.lang.String getInternalSubset()
Return the internalSubset given as a string.
getInternalSubset
in interface org.w3c.dom.DocumentType
public short getNodeType()
getNodeType
in interface org.w3c.dom.Node
getNodeType
in class NodeImpl
public java.lang.String getNodeName()
getNodeName
in interface org.w3c.dom.Node
getNodeName
in class NodeImpl
public org.w3c.dom.Node cloneNode(boolean deep)
cloneNode
in interface org.w3c.dom.Node
cloneNode
in class ParentNode
org.w3c.dom.Node
deep
- If true
, recursively clone the subtree under
the specified node; if false
, clone only the node
itself (and its attributes, if it is an Element
).public java.lang.String getTextContent() throws org.w3c.dom.DOMException
org.w3c.dom.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 org.w3c.dom.Node
getTextContent
in class ParentNode
org.w3c.dom.Node
org.w3c.dom.DOMException
- DOMSTRING_SIZE_ERR: Raised when it would return more characters than
fit in a DOMString
variable on the implementation
platform.public void setTextContent(java.lang.String textContent) throws org.w3c.dom.DOMException
org.w3c.dom.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 |
setTextContent
in interface org.w3c.dom.Node
setTextContent
in class ParentNode
org.w3c.dom.Node
org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.public boolean isEqualNode(org.w3c.dom.Node arg)
isEqualNode
in interface org.w3c.dom.Node
isEqualNode
in class ParentNode
org.w3c.dom.Node
arg
- The node to compare equality with.true
if the nodes are equal,
false
otherwise.protected void setOwnerDocument(CoreDocumentImpl doc)
setOwnerDocument
in class ParentNode
protected int getNodeNumber()
getNodeNumber
in class NodeImpl
public java.lang.String getName()
getName
in interface org.w3c.dom.DocumentType
public org.w3c.dom.NamedNodeMap getEntities()
<!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.
getEntities
in interface org.w3c.dom.DocumentType
public org.w3c.dom.NamedNodeMap getNotations()
getNotations
in interface org.w3c.dom.DocumentType
public void setReadOnly(boolean readOnly, boolean deep)
setReadOnly
in class ParentNode
NodeImpl.setReadOnly(boolean, boolean)
public org.w3c.dom.NamedNodeMap getElements()
ElementDefinitionImpl
public java.lang.Object setUserData(java.lang.String key, java.lang.Object data, org.w3c.dom.UserDataHandler handler)
org.w3c.dom.Node
getUserData
with the
same key.setUserData
in interface org.w3c.dom.Node
setUserData
in class NodeImpl
org.w3c.dom.Node
key
- The key to associate the object to.data
- The object to associate to the given key, or
null
to remove any existing association to that key.handler
- The handler to associate to that key, or
null
.DOMUserData
previously associated to
the given key on this node, or null
if there was none.public java.lang.Object getUserData(java.lang.String key)
org.w3c.dom.Node
setUserData
with the same key.getUserData
in interface org.w3c.dom.Node
getUserData
in class NodeImpl
org.w3c.dom.Node
key
- The key the object is associated to.DOMUserData
associated to the given
key on this node, or null
if there was none.protected java.util.Hashtable getUserDataRecord()
getUserDataRecord
in class NodeImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |