public class DocumentTypeImpl extends NodeImpl implements DocumentType
Document.getDoctype()
attribute whose value is either
null or an object that represents the document type definition (DTD).
HTML documents do not have a DTD. At the moment, this object provides
the list of entities that are defined for the document and little else.
Access is provided through NamedNodeMap
collections.
Notes:
Node.DOCUMENT_TYPE_NODE
Document
DocumentType
,
NodeImpl
,
NamedNodeMap
ATTLIST_DECL_NODE, ELEMENT_DECL_NODE, PARAM_ENTITY_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 and Description |
---|
DocumentTypeImpl(String qualifiedName,
String systemId,
String publicId,
String internalSubset) |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
protected void |
cloneInto(NodeImpl into,
boolean deep)
This clone method is called after a new node has been constructed to
copy the contents of this node into the new one.
|
Node |
cloneNode(boolean deep) |
short |
compareDocumentPosition(Node other) |
EntityImpl |
createEntity(String name,
String value)
Creates a new internal entity declaration and returns it.
|
EntityImpl |
createEntity(String name,
String systemId,
String publicId)
Creates a new external general entity declaration and returns it.
|
EntityImpl |
createEntity(String name,
String systemId,
String publicId,
String notation)
Creates a new unparsed general entity declaration and returns it.
|
Notation |
createNotation(String name,
String systemId,
String publicId)
Creates a new notation and returns it.
|
EntityImpl |
declareEntity(EntityImpl general)
Declares a new general entity declaration.
|
Notation |
declareNotation(Notation notation)
Declares a new notation.
|
boolean |
equals(Object other)
Returns true if this node and other are identical by content but
not context.
|
EntityImpl |
findEntity(String name)
Returns the named general entity declaration if one has been declared.
|
Notation |
findNotation(String name)
Returns the named notation if one has been declared.
|
String |
getBaseURI() |
NamedNodeMap |
getEntities() |
Object |
getFeature(String feature,
String version) |
String |
getInternalSubset() |
String |
getName() |
short |
getNodeType()
Abstract method must be implemented by each node class.
|
NamedNodeMap |
getNotations() |
String |
getPublicId() |
String |
getSystemId() |
String |
getTextContent() |
Object |
getUserData(String key) |
boolean |
hasAttributes() |
boolean |
isDefaultNamespace(String namespaceURI) |
boolean |
isEqualNode(Node arg) |
boolean |
isSameNode(Node other) |
boolean |
isSupported(String feature,
String version) |
String |
lookupNamespaceURI(String prefix) |
String |
lookupPrefix(String namespaceURI) |
void |
setTextContent(String textContent) |
Object |
setUserData(String key,
Object data,
UserDataHandler handler) |
String |
toString() |
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, insertBefore, isReadOnly, makeReadOnly, normalize, removeChild, replaceChild, setNodeValue, setOwnerDocument, setPrefix, supports
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, insertBefore, normalize, removeChild, replaceChild, setNodeValue, setPrefix
public short getNodeType()
NodeImpl
getNodeType
in interface Node
getNodeType
in class NodeImpl
Node.getNodeType()
public String getName()
getName
in interface DocumentType
public NamedNodeMap getEntities()
getEntities
in interface DocumentType
public NamedNodeMap getNotations()
getNotations
in interface DocumentType
public String getPublicId()
getPublicId
in interface DocumentType
public String getSystemId()
getSystemId
in interface DocumentType
public String getInternalSubset()
getInternalSubset
in interface DocumentType
public EntityImpl createEntity(String name, String systemId, String publicId)
name
- The notation namesystemId
- The system identifierpublicId
- The public identifierpublic EntityImpl createEntity(String name, String systemId, String publicId, String notation)
name
- The notation namesystemId
- The system identifierpublicId
- The public identifiernotation
- The notationpublic EntityImpl createEntity(String name, String value)
name
- The notation namevalue
- The entity valuepublic EntityImpl declareEntity(EntityImpl general)
general
- The general entity to declarepublic EntityImpl findEntity(String name)
name
- The entity namepublic Notation createNotation(String name, String systemId, String publicId)
name
- The notation namesystemId
- The system identifierpublicId
- The public identifierpublic Notation declareNotation(Notation notation)
notation
- The notation to declarepublic Notation findNotation(String name)
name
- The notation namepublic boolean equals(Object other)
NodeImpl
NodeImpl.equals(java.lang.Object)
on each pair
Note that for large document roots, the equality operation can be very expensive.
protected void cloneInto(NodeImpl into, boolean deep)
NodeImpl
NodeImpl.equals(java.lang.Object)
).
into must be a valid node of the exact same class as this one. deep is true if deep cloning (includes all children nodes) is to be performed. If deep is false, the clone might not pass the equality test.
Derived classes override and call this method to add per-class variable
copying. This method is called by Node.cloneNode(boolean)
and the default
Object.clone()
method.
Contents cloning duplicates the node's name and value, and its children. It does not duplicate it's context, that is, the node's parent or sibling. Initially a clone node has no parents or siblings. However, the node does belong to the same document, since all nodes must belong to some document. The cloned node is never read-only.
public short compareDocumentPosition(Node other) throws DOMException
compareDocumentPosition
in interface Node
DOMException
public String getBaseURI()
getBaseURI
in interface Node
public Object getFeature(String feature, String version)
getFeature
in interface Node
public String getTextContent() throws DOMException
getTextContent
in interface Node
DOMException
public Object getUserData(String key)
getUserData
in interface Node
public boolean isDefaultNamespace(String namespaceURI)
isDefaultNamespace
in interface Node
public boolean isEqualNode(Node arg)
isEqualNode
in interface Node
public boolean isSameNode(Node other)
isSameNode
in interface Node
public String lookupNamespaceURI(String prefix)
lookupNamespaceURI
in interface Node
public String lookupPrefix(String namespaceURI)
lookupPrefix
in interface Node
public void setTextContent(String textContent) throws DOMException
setTextContent
in interface Node
DOMException
public Object setUserData(String key, Object data, UserDataHandler handler)
setUserData
in interface Node
public boolean hasAttributes()
hasAttributes
in interface Node
public boolean isSupported(String feature, String version)
isSupported
in interface Node
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.