Package io.sf.carte.doc.dom
Class HTMLElement
java.lang.Object
io.sf.carte.doc.dom.DOMElement
io.sf.carte.doc.dom.HTMLElement
- All Implemented Interfaces:
DOMNode
,NonDocumentTypeChildNode
,ParentNode
,CSSElement
,CSSNode
,Serializable
,Element
,org.w3c.dom.html.HTMLElement
,Node
HTML-specific element nodes.
- See Also:
-
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 nodenewChild
to the end of the list of children of this node.short
compareDocumentPosition
(Node other) boolean
Test ifnode
is 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.short
abstract HTMLDocument
Get theDOMDocument
object 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) boolean
Does this node have any child nodes ?insertBefore
(Node newChild, Node refChild) Inserts the nodenewChild
right before noderefChild
in the child node list.boolean
isDefaultNamespace
(String namespaceURI) boolean
isEqualNode
(Node arg) boolean
isSameNode
(Node other) boolean
isSupported
(String feature, String version) Deprecated.void
prependChild
(Node newChild) void
Removes all the children from this node, if any.removeChild
(Node oldChild) Removes the nodeoldChild
from the children of this node.replaceChild
(Node newChild, Node oldChild) Replaces the nodeoldChild
withnewChild
.void
void
void
setNodeValue
(String nodeValue) void
void
setTextContent
(String textContent) void
setUserData
(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, getInnerText, getLastElementChild, getLocalName, getNodeName, getOverrideStyle, getSchemaTypeInfo, getSelectorMatcher, getStartTag, getStyle, getTagName, getTextContent, hasAttribute, hasAttributeNS, hasAttributes, hasOverrideStyle, hasPresentationalHints, iterator, iterator, iterator, iterator, listIterator, lookupNamespaceURI, lookupPrefix, matches, matches, querySelectorAll, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setClassName, setIdAttribute, setIdAttributeNode, setIdAttributeNS, toString, typeIterator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.sf.carte.doc.dom.DOMNode
appendChild, getFirstChild, getLastChild, getNextSibling, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, removeAllChild, removeChild, replaceChild
Methods 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, setIdAttributeNS
Methods inherited from interface org.w3c.dom.html.HTMLElement
getClassName, getId, setClassName, setId
Methods 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, setUserData
Methods inherited from interface io.sf.carte.doc.dom.ParentNode
getChildNodes, prependChild
-
Method Details
-
getDir
- Specified by:
getDir
in interfaceorg.w3c.dom.html.HTMLElement
-
setDir
- Specified by:
setDir
in interfaceorg.w3c.dom.html.HTMLElement
-
getLang
- Specified by:
getLang
in interfaceorg.w3c.dom.html.HTMLElement
-
setLang
- Specified by:
setLang
in interfaceorg.w3c.dom.html.HTMLElement
-
getTitle
- Specified by:
getTitle
in interfaceorg.w3c.dom.html.HTMLElement
-
setTitle
- Specified by:
setTitle
in interfaceorg.w3c.dom.html.HTMLElement
-
getOwnerDocument
Get theDOMDocument
object 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:
getOwnerDocument
in interfaceCSSNode
- Specified by:
getOwnerDocument
in interfaceDOMNode
- Specified by:
getOwnerDocument
in interfaceNode
- Returns:
- the
DOMDocument
object corresponding to this node. When this node is aDOMDocument
or aDocumentType
which was not added to anyDOMDocument
yet, this isnull
.
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceNode
-
getPrefix
-
setPrefix
- Specified by:
setPrefix
in interfaceNode
- Throws:
DOMException
-
hasChildNodes
public boolean hasChildNodes()Description copied from interface:DOMNode
Does this node have any child nodes ?- Specified by:
hasChildNodes
in interfaceDOMNode
- Specified by:
hasChildNodes
in interfaceNode
- Returns:
true
if this node has child nodes,false
otherwise.
-
getPreviousElementSibling
Description copied from interface:NonDocumentTypeChildNode
Gets the first preceding sibling that is an element.- Specified by:
getPreviousElementSibling
in interfaceNonDocumentTypeChildNode
- Returns:
- the first preceding sibling that is an element, and
null
otherwise.
-
getNextElementSibling
Description copied from interface:NonDocumentTypeChildNode
Gets the first following sibling that is an element.- Specified by:
getNextElementSibling
in interfaceNonDocumentTypeChildNode
- Returns:
- the first following sibling that is an element, and
null
otherwise.
-
prependChild
- Throws:
DOMException
-
getNodeValue
- Specified by:
getNodeValue
in interfaceNode
- Throws:
DOMException
-
setNodeValue
- Specified by:
setNodeValue
in interfaceNode
- Throws:
DOMException
-
getNodeType
public short getNodeType()- Specified by:
getNodeType
in interfaceNode
-
getParentNode
- Specified by:
getParentNode
in interfaceDOMNode
- Specified by:
getParentNode
in interfaceNode
-
getChildNodes
Description copied from interface:DOMNode
Get the children of this node.- Specified by:
getChildNodes
in interfaceDOMNode
- Specified by:
getChildNodes
in interfaceNode
- Returns:
- a
DOMNodeList
with the children of this node. If there are no children, an empty list is returned.
-
getFirstChild
Description copied from interface:DOMNode
Get the first child of this node.- Specified by:
getFirstChild
in interfaceDOMNode
- Specified by:
getFirstChild
in interfaceNode
- Returns:
- the first child of this node,
null
if has no child nodes.
-
getLastChild
Description copied from interface:DOMNode
Get the last child of this node.- Specified by:
getLastChild
in interfaceDOMNode
- Specified by:
getLastChild
in interfaceNode
- Returns:
- the last child of this node,
null
if has no child nodes.
-
getPreviousSibling
Description copied from interface:DOMNode
Get the node immediately preceding this node in its parent's child list.- Specified by:
getPreviousSibling
in interfaceDOMNode
- Specified by:
getPreviousSibling
in interfaceNode
- Returns:
- the node immediately preceding this node in the child list, or
null
if none.
-
getNextSibling
Description copied from interface:DOMNode
Get the node immediately following this node in its parent's child list.- Specified by:
getNextSibling
in interfaceDOMNode
- Specified by:
getNextSibling
in interfaceNode
- Returns:
- the node immediately following this node in the child list, or
null
if none.
-
appendChild
Description copied from interface:DOMNode
Adds the nodenewChild
to the end of the list of children of this node. If thenewChild
is already in the tree, it is first removed.- Specified by:
appendChild
in interfaceDOMNode
- Specified by:
appendChild
in interfaceNode
- Parameters:
newChild
- the node to append. If it is aDocumentFragment
object, 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 thenewChild
node, or if the node to append is one of this node's ancestors or this node itself, or if this node is of typeDocument
and the DOM application attempts to append a secondDocumentType
orElement
node.
WRONG_DOCUMENT_ERR: ifnewChild
was 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 ofnewChild
at this node.
-
insertBefore
Inserts the nodenewChild
right before noderefChild
in the child node list.- If
refChild
isnull
,newChild
is appended at the end of the child list. - If the
newChild
is already in the tree, it is first removed. - Inserting a node before itself has no effect.
- Specified by:
insertBefore
in interfaceDOMNode
- Specified by:
insertBefore
in interfaceNode
- Parameters:
newChild
- the node to put at the child node list, beforerefChild
. If it is aDocumentFragment
object, the entire contents of the document fragment are inserted into the child list of this node.refChild
- the node before whichnewChild
must 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 thenewChild
node, or if the node to append is one of this node's ancestors or this node itself, or if this node is of typeDocument
and the DOM application attempts to append a secondDocumentType
orElement
node.
WRONG_DOCUMENT_ERR: ifnewChild
was created from a different document than the one that created this node.
NOT_FOUND_ERR: ifrefChild
is not a child of this node.
NOT_SUPPORTED_ERR: if this implementation does not support children of the type ofnewChild
at this node.
- If
-
replaceChild
Replaces the nodeoldChild
withnewChild
. If thenewChild
is already in the tree, it is first removed.Replacing a node with itself has no effect.
- Specified by:
replaceChild
in interfaceDOMNode
- Specified by:
replaceChild
in interfaceNode
- Parameters:
newChild
- the node to put at the child node list, in place ofoldChild
. If it is aDocumentFragment
object, 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 thenewChild
node, or if the node to append is one of this node's ancestors or this node itself, or if this node is of typeDocument
and the DOM application attempts to append a secondDocumentType
orElement
node.
WRONG_DOCUMENT_ERR: ifnewChild
was created from a different document than the one that created this node.
NOT_FOUND_ERR: ifoldChild
is not a child of this node.
NOT_SUPPORTED_ERR: if this implementation does not support children of the type ofnewChild
at this node.
-
removeChild
Description copied from interface:DOMNode
Removes the nodeoldChild
from the children of this node.- Specified by:
removeChild
in interfaceDOMNode
- Specified by:
removeChild
in interfaceNode
- Parameters:
oldChild
- the node to remove.- Returns:
- the removed node.
- Throws:
DOMException
- NOT_FOUND_ERR: ifoldChild
is not a child of this node.
-
removeAllChild
public void removeAllChild()Description copied from interface:DOMNode
Removes all the children from this node, if any.- Specified by:
removeAllChild
in interfaceDOMNode
-
setUserData
- Specified by:
setUserData
in interfaceNode
-
getUserData
- Specified by:
getUserData
in interfaceNode
-
normalize
public void normalize() -
getFeature
Deprecated.This method is deprecated and not supported.- Specified by:
getFeature
in interfaceNode
- Parameters:
feature
- ignored.version
- ignored.- Returns:
null
.
-
isSupported
Deprecated.This method is not supported.- Specified by:
isSupported
in interfaceNode
- Parameters:
feature
- ignored.version
- ignored.- Returns:
- Always
true
.
-
compareDocumentPosition
- Specified by:
compareDocumentPosition
in interfaceNode
- Throws:
DOMException
-
setTextContent
- Specified by:
setTextContent
in interfaceNode
- Throws:
DOMException
-
isDefaultNamespace
- Specified by:
isDefaultNamespace
in interfaceNode
-
isEqualNode
- Specified by:
isEqualNode
in interfaceNode
-
isSameNode
- Specified by:
isSameNode
in interfaceNode
-
contains
Test ifnode
is an inclusive descendant of this node.- Parameters:
node
- the node to test.- Returns:
true
ifnode
is an inclusive descendant of this node,false
otherwise (includingnode
beingnull
).
-