public final class HTMLDocumentImpl extends DocumentImpl implements org.w3c.dom.html.HTMLDocument
Several methods create new nodes of all basic types (comment, text, element,
etc.). These methods create new nodes but do not place them in the document
tree. The nodes may be placed in the document tree using Node.appendChild(org.w3c.dom.Node)
or Node.insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
, or
they may be placed in some other document tree.
Note: <FRAMESET> documents are not supported at the moment, neither
are direct document writing (open()
, write(java.lang.String)
) and HTTP attribute
methods (getURL()
, getCookie()
).
HTMLDocument
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 |
---|
HTMLDocumentImpl() |
acquire, adoptNode, cloneInto, compareDocumentPosition, createAttribute, createAttribute, createAttributeNS, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createEntityReference, createNodeIterator, createProcessingInstruction, createTextNode, equals, getBaseURI, getDoctype, getDocumentURI, getDomConfig, getEncoding, getFeature, getImplementation, getInputEncoding, getNamespaceURI, getNodeType, getStandalone, getStrictErrorChecking, getTextContent, getUserData, getVersion, getXmlEncoding, getXmlStandalone, getXmlVersion, hasAttributes, importNode, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lock, lookupNamespaceURI, lookupPrefix, normalizeDocument, registerElement, renameNode, setDocumentURI, setEncoding, setNodeValue, setStandalone, setStrictErrorChecking, setTextContent, setUserData, setVersion, setXmlStandalone, setXmlVersion, toString, unlock, useElementFactory
appendChild, castOldChild, createNodeIterator, getChildNodes, getFirstChild, getLastChild, hasChildNodes, insertBefore, normalize, removeChild, removeInnerIterator, replaceChild
getAttributes, getLocalName, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, isReadOnly, makeReadOnly, setOwnerDocument, setPrefix, supports
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentURI, getDomConfig, getImplementation, getInputEncoding, getStrictErrorChecking, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, normalizeDocument, renameNode, setDocumentURI, setStrictErrorChecking, setXmlStandalone, setXmlVersion
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
public Element getDocumentElement()
getDocumentElement
in interface Document
getDocumentElement
in class DocumentImpl
public org.w3c.dom.html.HTMLElement getHead()
getDocumentElement()
. If the element does not exist, one
is created.
Called by getTitle()
, setTitle(java.lang.String)
, getBody()
and
setBody(org.w3c.dom.html.HTMLElement)
to assure the document has the <HEAD> element
correctly placed.
public String getTitle()
getTitle
in interface org.w3c.dom.html.HTMLDocument
public void setTitle(String newTitle)
setTitle
in interface org.w3c.dom.html.HTMLDocument
public org.w3c.dom.html.HTMLElement getBody()
getBody
in interface org.w3c.dom.html.HTMLDocument
public void setBody(org.w3c.dom.html.HTMLElement newBody)
setBody
in interface org.w3c.dom.html.HTMLDocument
public Element getElementById(String elementId)
getElementById
in interface Document
getElementById
in class DocumentImpl
public NodeList getElementsByName(String elementName)
getElementsByName
in interface org.w3c.dom.html.HTMLDocument
public final NodeList getElementsByTagName(String tagName)
getElementsByTagName
in interface Document
getElementsByTagName
in class DocumentImpl
public final NodeList getElementsByTagNameNS(String namespaceURI, String localName)
getElementsByTagNameNS
in interface Document
getElementsByTagNameNS
in class DocumentImpl
public Element createElementNS(String namespaceURI, String qualifiedName)
createElementNS
in interface Document
createElementNS
in class DocumentImpl
public Element createElement(String tagName) throws DOMException
createElement
in interface Document
createElement
in class DocumentImpl
DOMException
public String getReferrer()
getReferrer
in interface org.w3c.dom.html.HTMLDocument
public String getDomain()
getDomain
in interface org.w3c.dom.html.HTMLDocument
public String getURL()
getURL
in interface org.w3c.dom.html.HTMLDocument
public String getCookie()
getCookie
in interface org.w3c.dom.html.HTMLDocument
public void setCookie(String cookie)
setCookie
in interface org.w3c.dom.html.HTMLDocument
public org.w3c.dom.html.HTMLCollection getImages()
getImages
in interface org.w3c.dom.html.HTMLDocument
public org.w3c.dom.html.HTMLCollection getApplets()
getApplets
in interface org.w3c.dom.html.HTMLDocument
public org.w3c.dom.html.HTMLCollection getLinks()
getLinks
in interface org.w3c.dom.html.HTMLDocument
public org.w3c.dom.html.HTMLCollection getForms()
getForms
in interface org.w3c.dom.html.HTMLDocument
public org.w3c.dom.html.HTMLCollection getAnchors()
getAnchors
in interface org.w3c.dom.html.HTMLDocument
public void open()
open
in interface org.w3c.dom.html.HTMLDocument
public void close()
close
in interface org.w3c.dom.html.HTMLDocument
public void write(String text)
write
in interface org.w3c.dom.html.HTMLDocument
public void writeln(String text)
writeln
in interface org.w3c.dom.html.HTMLDocument
public Object clone()
clone
in class DocumentImpl
public Node cloneNode(boolean deep)
cloneNode
in interface Node
cloneNode
in class DocumentImpl
protected NodeImpl castNewChild(Node newChild) throws DOMException
ParentNodeImpl
The following rules govern the allowed newChild types:
Attr
, newChild must be
either a Text
or an EntityReference
DocumentType
, newChild must be
either an Entity
or a Notation
.
Element
, a CharacterData
derived type, a DocumentFragment
, an EntityReference
or a ProcessingInstruction
.
castNewChild
in class ParentNodeImpl
newChild
- New child nodeNodeImpl
DOMException
- HIERARCHY_REQUEST_ERR
newChild is null, does not belong to this DOM, or its node
type is not supported for this parentPhantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.