java.lang.Object
io.sf.carte.doc.dom.DOMElement
io.sf.carte.doc.dom.HTMLElement
- All Implemented Interfaces:
DOMNode,NonDocumentTypeChildNode,ParentNode,CSSElement,CSSNode,ElementCSSInlineStyle,Element,HTMLElement,Node
HTML-specific element nodes.
-
Field Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionappendChild(Node newChild) Adds the nodenewChildto the end of the list of children of this node.shortcompareDocumentPosition(Node other) booleanTest ifnodeis an inclusive descendant of this node.Get the children of this node.getDir()getFeature(String feature, String version) Deprecated.Get the first child of this node.getLang()Get the last child of this node.Gets the first following sibling that is an element.Get the node immediately following this node in its parent's child list.shortabstract HTMLDocumentGet theDOMDocumentobject related to this node (for all nodes exceptDocumentType, it is the document that created it), which is also the object that should be used to create new nodes for the document.Gets the first preceding sibling that is an element.Get the node immediately preceding this node in its parent's child list.getTitle()getUserData(String key) booleanDoes this node have any child nodes ?insertBefore(Node newChild, Node refChild) Inserts the nodenewChildright before noderefChildin the child node list.booleanisDefaultNamespace(String namespaceURI) booleanisEqualNode(Node arg) booleanisSameNode(Node other) booleanisSupported(String feature, String version) Deprecated.voidprependChild(Node newChild) removeChild(Node oldChild) Removes the nodeoldChildfrom the children of this node.replaceChild(Node newChild, Node oldChild) Replaces the nodeoldChildwithnewChild.voidvoidvoidsetNodeValue(String nodeValue) voidvoidsetTextContent(String textContent) voidsetUserData(String key, Object data, UserDataHandler handler) Methods inherited from class io.sf.carte.doc.dom.DOMElement
cloneNode, descendingIterator, elementIterator, elementIterator, elementIteratorNS, exportHintsToStyle, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getChildElementCount, getChildren, getClassList, getClassName, getComputedStyle, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getId, getLastElementChild, getLocalName, getNodeName, getOverrideStyle, getSchemaTypeInfo, getSelectorMatcher, getStartTag, getStyle, getTagName, hasAttribute, hasAttributeNS, hasAttributes, hasOverrideStyle, hasPresentationalHints, iterator, iterator, iterator, iterator, listIterator, lookupNamespaceURI, lookupPrefix, matches, matches, querySelectorAll, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setClassName, toString, typeIteratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.sf.carte.doc.dom.DOMNode
appendChild, getFirstChild, getLastChild, getNextSibling, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, removeChild, replaceChildMethods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNSMethods inherited from interface org.w3c.dom.html.HTMLElement
getClassName, getId, setClassName, setIdMethods inherited from interface org.w3c.dom.Node
cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getFeature, getLocalName, getNamespaceURI, getNodeName, getNodeType, getNodeValue, getPrefix, getTextContent, getUserData, hasAttributes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, setNodeValue, setPrefix, setTextContent, setUserDataMethods inherited from interface io.sf.carte.doc.dom.ParentNode
getChildNodes, prependChild
-
Method Details
-
getDir
- Specified by:
getDirin interfaceHTMLElement
-
setDir
- Specified by:
setDirin interfaceHTMLElement
-
getLang
- Specified by:
getLangin interfaceHTMLElement
-
setLang
- Specified by:
setLangin interfaceHTMLElement
-
getTitle
- Specified by:
getTitlein interfaceHTMLElement
-
setTitle
- Specified by:
setTitlein interfaceHTMLElement
-
getOwnerDocument
Get theDOMDocumentobject related to this node (for all nodes exceptDocumentType, it is the document that created it), which is also the object that should be used to create new nodes for the document.- Specified by:
getOwnerDocumentin interfaceCSSNode- Specified by:
getOwnerDocumentin interfaceDOMNode- Specified by:
getOwnerDocumentin interfaceNode- Returns:
- the
DOMDocumentobject corresponding to this node. When this node is aDOMDocumentor aDocumentTypewhich was not added to anyDOMDocumentyet, this isnull.
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceNode
-
getPrefix
-
setPrefix
- Specified by:
setPrefixin interfaceNode- Throws:
DOMException
-
hasChildNodes
public boolean hasChildNodes()Description copied from interface:DOMNodeDoes this node have any child nodes ?- Specified by:
hasChildNodesin interfaceDOMNode- Specified by:
hasChildNodesin interfaceNode- Returns:
trueif this node has child nodes,falseotherwise.
-
getPreviousElementSibling
Description copied from interface:NonDocumentTypeChildNodeGets the first preceding sibling that is an element.- Specified by:
getPreviousElementSiblingin interfaceNonDocumentTypeChildNode- Returns:
- the first preceding sibling that is an element, and
nullotherwise.
-
getNextElementSibling
Description copied from interface:NonDocumentTypeChildNodeGets the first following sibling that is an element.- Specified by:
getNextElementSiblingin interfaceNonDocumentTypeChildNode- Returns:
- the first following sibling that is an element, and
nullotherwise.
-
prependChild
- Throws:
DOMException
-
getNodeValue
- Specified by:
getNodeValuein interfaceNode- Throws:
DOMException
-
setNodeValue
- Specified by:
setNodeValuein interfaceNode- Throws:
DOMException
-
getNodeType
public short getNodeType()- Specified by:
getNodeTypein interfaceNode
-
getParentNode
- Specified by:
getParentNodein interfaceDOMNode- Specified by:
getParentNodein interfaceNode
-
getChildNodes
Description copied from interface:DOMNodeGet the children of this node.- Specified by:
getChildNodesin interfaceDOMNode- Specified by:
getChildNodesin interfaceNode- Returns:
- a
DOMNodeListwith the children of this node. If there are no children, an empty list is returned.
-
getFirstChild
Description copied from interface:DOMNodeGet the first child of this node.- Specified by:
getFirstChildin interfaceDOMNode- Specified by:
getFirstChildin interfaceNode- Returns:
- the first child of this node,
nullif has no child nodes.
-
getLastChild
Description copied from interface:DOMNodeGet the last child of this node.- Specified by:
getLastChildin interfaceDOMNode- Specified by:
getLastChildin interfaceNode- Returns:
- the last child of this node,
nullif has no child nodes.
-
getPreviousSibling
Description copied from interface:DOMNodeGet the node immediately preceding this node in its parent's child list.- Specified by:
getPreviousSiblingin interfaceDOMNode- Specified by:
getPreviousSiblingin interfaceNode- Returns:
- the node immediately preceding this node in the child list, or
nullif none.
-
getNextSibling
Description copied from interface:DOMNodeGet the node immediately following this node in its parent's child list.- Specified by:
getNextSiblingin interfaceDOMNode- Specified by:
getNextSiblingin interfaceNode- Returns:
- the node immediately following this node in the child list, or
nullif none.
-
appendChild
Description copied from interface:DOMNodeAdds the nodenewChildto the end of the list of children of this node. If thenewChildis already in the tree, it is first removed.- Specified by:
appendChildin interfaceDOMNode- Specified by:
appendChildin interfaceNode- Parameters:
newChild- the node to append. If it is aDocumentFragmentobject, the entire contents of the document fragment are moved into the child list of this node.- Returns:
- the appended node.
- Throws:
DOMException- HIERARCHY_REQUEST_ERR: raised if this node is of a type that does not allow children of the type of thenewChildnode, or if the node to append is one of this node's ancestors or this node itself, or if this node is of typeDocumentand the DOM application attempts to append a secondDocumentTypeorElementnode.
WRONG_DOCUMENT_ERR: ifnewChildwas created from a different document than the one that created this node.
NOT_SUPPORTED_ERR: if this implementation does not support children of the type ofnewChildat this node.
-
insertBefore
Inserts the nodenewChildright before noderefChildin the child node list.- If
refChildisnull,newChildis appended at the end of the child list. - If the
newChildis already in the tree, it is first removed. - Inserting a node before itself has no effect.
- Specified by:
insertBeforein interfaceDOMNode- Specified by:
insertBeforein interfaceNode- Parameters:
newChild- the node to put at the child node list, beforerefChild. If it is aDocumentFragmentobject, the entire contents of the document fragment are inserted into the child list of this node.refChild- the node before whichnewChildmust be inserted.- Returns:
- the inserted node.
- Throws:
DOMException- HIERARCHY_REQUEST_ERR: raised if this node is of a type that does not allow children of the type of thenewChildnode, or if the node to append is one of this node's ancestors or this node itself, or if this node is of typeDocumentand the DOM application attempts to append a secondDocumentTypeorElementnode.
WRONG_DOCUMENT_ERR: ifnewChildwas created from a different document than the one that created this node.
NOT_FOUND_ERR: ifrefChildis not a child of this node.
NOT_SUPPORTED_ERR: if this implementation does not support children of the type ofnewChildat this node.
- If
-
replaceChild
Replaces the nodeoldChildwithnewChild. If thenewChildis already in the tree, it is first removed.Replacing a node with itself has no effect.
- Specified by:
replaceChildin interfaceDOMNode- Specified by:
replaceChildin interfaceNode- Parameters:
newChild- the node to put at the child node list, in place ofoldChild. If it is aDocumentFragmentobject, the entire contents of the document fragment are inserted into the child list of this node.oldChild- the node being replaced.- Returns:
- the replaced (old) node.
- Throws:
DOMException- HIERARCHY_REQUEST_ERR: raised if this node is of a type that does not allow children of the type of thenewChildnode, or if the node to append is one of this node's ancestors or this node itself, or if this node is of typeDocumentand the DOM application attempts to append a secondDocumentTypeorElementnode.
WRONG_DOCUMENT_ERR: ifnewChildwas created from a different document than the one that created this node.
NOT_FOUND_ERR: ifoldChildis not a child of this node.
NOT_SUPPORTED_ERR: if this implementation does not support children of the type ofnewChildat this node.
-
removeChild
Description copied from interface:DOMNodeRemoves the nodeoldChildfrom the children of this node.- Specified by:
removeChildin interfaceDOMNode- Specified by:
removeChildin interfaceNode- Parameters:
oldChild- the node to remove.- Returns:
- the removed node.
- Throws:
DOMException- NOT_FOUND_ERR: ifoldChildis not a child of this node.
-
setUserData
- Specified by:
setUserDatain interfaceNode
-
getUserData
- Specified by:
getUserDatain interfaceNode
-
normalize
public void normalize() -
getFeature
Deprecated.This method is deprecated and not supported.- Specified by:
getFeaturein interfaceNode- Parameters:
feature- ignored.version- ignored.- Returns:
null.
-
isSupported
Deprecated.This method is not supported.- Specified by:
isSupportedin interfaceNode- Parameters:
feature- ignored.version- ignored.- Returns:
- Always
true.
-
compareDocumentPosition
- Specified by:
compareDocumentPositionin interfaceNode- Throws:
DOMException
-
getTextContent
- Specified by:
getTextContentin interfaceNode- Throws:
DOMException
-
setTextContent
- Specified by:
setTextContentin interfaceNode- Throws:
DOMException
-
isDefaultNamespace
- Specified by:
isDefaultNamespacein interfaceNode
-
isEqualNode
- Specified by:
isEqualNodein interfaceNode
-
isSameNode
- Specified by:
isSameNodein interfaceNode
-
contains
Test ifnodeis an inclusive descendant of this node.- Parameters:
node- the node to test.- Returns:
trueifnodeis an inclusive descendant of this node,falseotherwise (includingnodebeingnull).
-