Class NodeImpl
- All Implemented Interfaces:
Cloneable,EventTarget,ModelNode,Node,ScriptableDelegate
- Direct Known Subclasses:
AttrImpl,CharacterDataImpl,DocumentFragmentImpl,DocumentImpl,DocumentTypeImpl,ElementImpl,EntityReferenceImpl,NotationImpl
Abstract NodeImpl class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Documentprotected final NodeListImplprotected booleanprotected Nodeprotected UINodeFields inherited from interface org.loboevolution.html.node.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, NONE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendChild(Node newChild) appendChild.voidappendChildrenToCollectionImpl(NodeFilter filter, Collection<Node> collection) protected voidappendInnerHTMLImpl(StringBuilder buffer) appendInnerHTMLImpl.protected voidappendInnerTextImpl(StringBuilder buffer) appendInnerTextImpl.clone()cloneNode.cloneNode(boolean deep) Returns a copy of node.shortcompareDocumentPosition(Node other) compareDocumentPosition.booleanReturns true if other is an inclusive descendant of node, and false otherwise.protected RenderStatecreateRenderState(RenderState prevRenderState) createRenderState.voidextractDescendentsArrayImpl(NodeFilter filter, List<Node> al, boolean nestIntoMatchingNodes) Extracts all descendents that match the filter, except those descendents of nodes that match the filter.Tries to get a UINode associated with the current node.voidshortgetAttributes.Returns node's node document's document base URL.shortintgetChildIndex(Node child) getChildIndex.Returns the children.getChildren.shortgetDescendents(NodeFilter filter, boolean nestIntoMatchingNodes) Creates an NodeList of descendent nodes that the given filter condition.shortshortshortshortshortshortshortshortshortgetDocumentItem(String name) getDocumentItem.getDocumentNode.getDocumentURL.shortshortshortgetFeature(String feature, String version) Returns the first child.getFirstChildByFilter(NodeFilter filter) getFirstChildByFilter.getFullURL(String spec) getFullURL.getHtmlRendererContext.getHtmlRendererContext.Returns the last child.abstract StringgetLocalName.getNamespaceURI.getNextElementSibling.Returns the next sibling.getNodeList(NodeFilter filter) Getter for the field nodeList.abstract StringReturns a string appropriate for the type of node.abstract intReturns the type of node.abstract StringgetNodeValue.shortgetNONE()shortReturns the node document.Returns the parent element.final ModelNodegetParentModelNode.Returns the parent.protected final RenderStategetParentRenderState(Object parent) getParentRenderState.Returns prefix.getPreviousElementSibling.Returns the previous sibling.getPreviousTo(Node node) shortgetRenderState.Returns node's root.shortgetTextContent.getUINode.getUserAgentContext.getUserData(String key) getUserData.booleanReturns whether node has children.protected StringhtmlEncodeChildText(String text) htmlEncodeChildText.voidinformInvalid.voidinformLayoutInvalid.voidinformLookInvalid.protected voidinformNodeLoaded.voidinformPositionInvalid.voidinformSizeInvalid.voidinformStructureInvalid.insertAfter(Node newChild, Node refChild) insertAfter.protected NodeinsertAt.insertBefore(Node newChild, Node refChild) insertBefore.booleanisDefaultNamespace(String namespaceURI) isDefaultNamespace.booleanisEqualNode(Node arg) Returns whether node and otherNode have the same properties.final booleanisEqualOrDescendentOf(ModelNode otherContext) isEqualOrDescendentOf.booleanReturns true if node is connected and false otherwise.booleanisSameNode(Node other) isSameNode.booleanisSupported(String feature, String version) lookupNamespaceURI(String prefix) lookupNamespaceURI.lookupPrefix(String namespaceURI) lookupPrefix.voidRemoves empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.prepend.prependChild(Node newChild) prependChild.removeChild(Node oldChild) removeChild.removeChildAt(int index) removeChildAt.protected voidremoveChildrenImpl(NodeFilter filter) removeChildrenImpl.protected voidremoveTableChildren(NodeFilter filter) removeChildren.replaceAdjacentTextNodes(Text node, String textContent) replaceAdjacentTextNodes.replaceChild(Node newChild, Node oldChild) replaceChild.voidsetDocumentItem(String name, Object value) Sets a document item.abstract voidsetNodeValue(String nodeValue) setNodeValue.voidsetOwnerDocument(Document value) setOwnerDocument.voidsetOwnerDocument(Document value, boolean deep) setOwnerDocument.final voidsetParentImpl(Node parent) setParentImpl.voidsetPrefix.voidsetTextContent(String textContent) setTextContent.voidsetUINode.setUserData(String key, Object data, UserDataHandler handler) setUserData.toString()voidvisit(NodeVisitor visitor) visit.voidvisitImpl(NodeVisitor visitor) visitImpl.voidwarn.voidwarn.Methods inherited from class org.loboevolution.html.dom.nodeimpl.event.EventTargetImpl
addEventListener, addEventListener, dispatchEvent, dispatchEvent, getFunction, removeEventListener, removeEventListenerMethods inherited from class org.loboevolution.js.AbstractScriptableDelegate
getScriptable, setScriptableMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.loboevolution.events.EventTarget
addEventListener, addEventListener, dispatchEvent, dispatchEvent, removeEventListener, removeEventListenerMethods inherited from interface org.loboevolution.html.node.Node
hasAttributes, setNamespaceURI
-
Field Details
-
document
-
nodeList
-
notificationsSuspended
protected volatile boolean notificationsSuspended -
parentNode
-
uiNode
-
-
Constructor Details
-
NodeImpl
public NodeImpl()Constructor for NodeImpl.
-
-
Method Details
-
appendChild
appendChild.
- Specified by:
appendChildin interfaceNode- Parameters:
newChild- aNodeobject.- Returns:
- a
Nodeobject.
-
prependChild
prependChild.
- Specified by:
prependChildin interfaceNode- Parameters:
newChild- aNodeobject.- Returns:
- a
Nodeobject.
-
prepend
prepend.
-
appendChildrenToCollectionImpl
- Specified by:
appendChildrenToCollectionImplin interfaceNode
-
appendInnerHTMLImpl
appendInnerHTMLImpl.
- Parameters:
buffer- aStringBuilderobject.
-
appendInnerTextImpl
appendInnerTextImpl.
- Parameters:
buffer- aStringBuilderobject.
-
cloneNode
cloneNode.
-
cloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants. -
contains
Returns true if other is an inclusive descendant of node, and false otherwise. -
isSupported
- Specified by:
isSupportedin interfaceNode
-
compareDocumentPosition
compareDocumentPosition.
- Specified by:
compareDocumentPositionin interfaceNode- Parameters:
other- aNodeobject.- Returns:
- a short.
-
createRenderState
createRenderState.
- Parameters:
prevRenderState- aRenderStateobject.- Returns:
- a
RenderStateobject.
-
getAttributes
Description copied from interface:NodegetAttributes.
- Specified by:
getAttributesin interfaceNode- Returns:
- a
NamedNodeMapobject.
-
extractDescendentsArrayImpl
public void extractDescendentsArrayImpl(NodeFilter filter, List<Node> al, boolean nestIntoMatchingNodes) Extracts all descendents that match the filter, except those descendents of nodes that match the filter.- Specified by:
extractDescendentsArrayImplin interfaceNode- Parameters:
filter- aNodeFilterobject.al- aArrayListobject.
-
findUINode
Tries to get a UINode associated with the current node. Failing that, it tries ancestors recursively. This method will return the closest block-level renderer node, if any.- Specified by:
findUINodein interfaceNode- Returns:
- a
UINodeobject.
-
forgetRenderState
public void forgetRenderState()- Specified by:
forgetRenderStatein interfaceNode
-
getBaseURI
Returns node's node document's document base URL.- Specified by:
getBaseURIin interfaceNode- Returns:
- a
Stringobject.
-
getChildIndex
getChildIndex.
-
getChildNodes
Returns the children.- Specified by:
getChildNodesin interfaceNode- Returns:
- a
NodeListobject.
-
getChildren
getChildren.
- Returns:
- a
HTMLCollectionobject.
-
getDescendents
Creates an NodeList of descendent nodes that the given filter condition.- Parameters:
filter- aNodeFilterobject.nestIntoMatchingNodes- a boolean.- Returns:
- a
NodeListobject.
-
getDocumentItem
getDocumentItem.
- Specified by:
getDocumentItemin interfaceModelNode- Parameters:
name- aStringobject.- Returns:
- a
Objectobject.
-
getDocumentURL
getDocumentURL.
- Returns:
- a
URLobject.
-
getFirstChild
Returns the first child.- Specified by:
getFirstChildin interfaceNode- Returns:
- a
Nodeobject.
-
getFirstChildByFilter
getFirstChildByFilter.
- Parameters:
filter- aNodeFilterobject.- Returns:
- a
Nodeobject.
-
getFullURL
getFullURL.
- Specified by:
getFullURLin interfaceModelNode- Parameters:
spec- aStringobject.- Returns:
- a
URLobject. - Throws:
Exception- if any.
-
getHtmlRendererContext
getHtmlRendererContext.
- Returns:
- a
HtmlRendererContextobject.
-
getHtmlRendererConfig
getHtmlRendererContext.
- Returns:
- a
HtmlRendererConfigobject.
-
getLastChild
Returns the last child.- Specified by:
getLastChildin interfaceNode- Returns:
- a
Nodeobject.
-
getLocalName
getLocalName.
- Specified by:
getLocalNamein interfaceNode- Returns:
- a
Stringobject.
-
getNamespaceURI
getNamespaceURI.
- Specified by:
getNamespaceURIin interfaceNode- Returns:
- a
Stringobject.
-
getNextSibling
Returns the next sibling.- Specified by:
getNextSiblingin interfaceNode- Returns:
- a
Nodeobject.
-
getNextElementSibling
getNextElementSibling.
- Returns:
- a
Elementobject.
-
getNextTo
-
getNodeList
Getter for the field nodeList.
- Parameters:
filter- aNodeFilterobject.- Returns:
- a
NodeListobject.
-
getNodeName
Returns a string appropriate for the type of node.- Specified by:
getNodeNamein interfaceNode- Returns:
- a
Stringobject.
-
getNodeType
public abstract int getNodeType()Returns the type of node.- Specified by:
getNodeTypein interfaceNode- Returns:
- a
Integerobject.
-
getNodeValue
getNodeValue.
- Specified by:
getNodeValuein interfaceNode- Returns:
- a
Stringobject. - Throws:
DOMException
-
getOwnerDocument
Returns the node document. Returns null for documents.- Specified by:
getOwnerDocumentin interfaceNode- Returns:
- a
Documentobject.
-
getParentModelNode
getParentModelNode.
- Specified by:
getParentModelNodein interfaceModelNode- Returns:
- a
ModelNodeobject.
-
getParentNode
Returns the parent.- Specified by:
getParentNodein interfaceNode- Returns:
- a
Nodeobject.
-
getParentElement
Returns the parent element.- Specified by:
getParentElementin interfaceNode- Returns:
- a
HTMLElementobject.
-
getParentRenderState
getParentRenderState.
- Parameters:
parent- aObjectobject.- Returns:
- a
RenderStateobject.
-
getPrefix
Returns prefix. -
getPreviousSibling
Returns the previous sibling.- Specified by:
getPreviousSiblingin interfaceNode- Returns:
- a
Nodeobject.
-
getPreviousElementSibling
getPreviousElementSibling.
- Returns:
- a
Elementobject.
-
getPreviousTo
- Specified by:
getPreviousToin interfaceNode
-
getRenderState
getRenderState.
- Specified by:
getRenderStatein interfaceModelNode
-
getTextContent
getTextContent.
Gets the text content of this node and its descendents.- Specified by:
getTextContentin interfaceNode- Returns:
- a
Stringobject.
-
getUINode
getUINode.
- Returns:
- a
UINodeobject.
-
getUserAgentContext
getUserAgentContext.
- Returns:
- a
UserAgentContextobject.
-
getUserData
getUserData.
- Specified by:
getUserDatain interfaceNode- Parameters:
key- aStringobject.- Returns:
- a
Objectobject.
-
hasChildNodes
public boolean hasChildNodes()Returns whether node has children.- Specified by:
hasChildNodesin interfaceNode- Returns:
- a boolean.
-
htmlEncodeChildText
htmlEncodeChildText.
-
informInvalid
public void informInvalid()informInvalid.
-
informLayoutInvalid
public void informLayoutInvalid()informLayoutInvalid.
-
informLookInvalid
public void informLookInvalid()informLookInvalid.
-
informNodeLoaded
protected void informNodeLoaded()informNodeLoaded.
-
informPositionInvalid
public void informPositionInvalid()informPositionInvalid.
-
informSizeInvalid
public void informSizeInvalid()informSizeInvalid.
-
informStructureInvalid
public void informStructureInvalid()informStructureInvalid.
-
getDocumentNode
getDocumentNode.
- Specified by:
getDocumentNodein interfaceNode- Returns:
- the document
-
insertAfter
insertAfter.
-
insertAt
insertAt.
- Parameters:
newChild- aNodeobject.idx- aIntegerobject.- Returns:
- a
Nodeobject. - Throws:
DOMException- if any.
-
insertBefore
insertBefore.
- Specified by:
insertBeforein interfaceNode- Parameters:
newChild- aNodeobject.refChild- aNodeobject.- Returns:
- a
Nodeobject.
-
isDefaultNamespace
isDefaultNamespace.
- Specified by:
isDefaultNamespacein interfaceNode- Parameters:
namespaceURI- aStringobject.- Returns:
- a boolean.
-
isEqualNode
Returns whether node and otherNode have the same properties.- Specified by:
isEqualNodein interfaceNode- Parameters:
arg- aNodeobject.- Returns:
- a boolean.
-
isEqualOrDescendentOf
isEqualOrDescendentOf.
- Specified by:
isEqualOrDescendentOfin interfaceModelNode- Parameters:
otherContext- aModelNodeobject.- Returns:
- a boolean.
-
isSameNode
isSameNode.
- Specified by:
isSameNodein interfaceNode- Parameters:
other- aNodeobject.- Returns:
- a boolean.
-
lookupNamespaceURI
lookupNamespaceURI.
- Specified by:
lookupNamespaceURIin interfaceNode- Parameters:
prefix- aStringobject.- Returns:
- a
Stringobject.
-
lookupPrefix
lookupPrefix.
- Specified by:
lookupPrefixin interfaceNode- Parameters:
namespaceURI- aStringobject.- Returns:
- a
Stringobject.
-
normalize
public void normalize()Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -
removeChild
removeChild.
- Specified by:
removeChildin interfaceNode- Parameters:
oldChild- aNodeobject.- Returns:
- a
Nodeobject.
-
removeChildAt
removeChildAt.
- Parameters:
index- aIntegerobject.- Returns:
- a
Nodeobject. - Throws:
DOMException- if any.
-
removeTableChildren
removeChildren.
- Parameters:
filter- aNodeFilterobject.
-
removeChildrenImpl
removeChildrenImpl.
- Parameters:
filter- aNodeFilterobject.
-
replaceAdjacentTextNodes
replaceAdjacentTextNodes.
-
replaceChild
replaceChild.
- Specified by:
replaceChildin interfaceNode- Parameters:
newChild- aNodeobject.oldChild- aNodeobject.- Returns:
- a
Nodeobject.
-
setDocumentItem
Sets a document item. A radio button, for example, can use this to set button group state.- Specified by:
setDocumentItemin interfaceModelNode- Parameters:
name- aStringobject.value- aObjectobject.
-
setNodeValue
setNodeValue.
- Specified by:
setNodeValuein interfaceNode- Parameters:
nodeValue- aStringobject.- Throws:
DOMException
-
setOwnerDocument
setOwnerDocument.
- Specified by:
setOwnerDocumentin interfaceNode- Parameters:
value- aDocumentobject.
-
setOwnerDocument
setOwnerDocument.
- Specified by:
setOwnerDocumentin interfaceNode- Parameters:
value- aDocumentobject.deep- a boolean.
-
setParentImpl
setParentImpl.
- Specified by:
setParentImplin interfaceNode- Parameters:
parent- aNodeobject.
-
setPrefix
setPrefix.
- Specified by:
setPrefixin interfaceNode- Parameters:
prefix- aStringobject.- Throws:
DOMException
-
setTextContent
setTextContent.
- Specified by:
setTextContentin interfaceNode- Parameters:
textContent- aStringobject.
-
setUINode
setUINode.
- Parameters:
uiNode- aUINodeobject.
-
setUserData
setUserData.
- Specified by:
setUserDatain interfaceNode- Parameters:
key- aStringobject.data- aObjectobject.handler- aUserDataHandlerobject.- Returns:
- a
Objectobject.
-
isIsConnected
public boolean isIsConnected()Returns true if node is connected and false otherwise.- Specified by:
isIsConnectedin interfaceNode- Returns:
- a boolean.
-
getRootNode
Returns node's root.- Specified by:
getRootNodein interfaceNode- Returns:
- a
Nodeobject.
-
getFeature
- Specified by:
getFeaturein interfaceNode
-
toString
-
visit
visit.
- Specified by:
visitin interfaceNode- Parameters:
visitor- aNodeVisitorobject.
-
visitImpl
visitImpl.
- Parameters:
visitor- aNodeVisitorobject.
-
warn
warn.
- Parameters:
message- aStringobject.
-
warn
warn.
-
clone
-
getNONE
public short getNONE() -
getELEMENT_NODE
public short getELEMENT_NODE() -
getATTRIBUTE_NODE
public short getATTRIBUTE_NODE() -
getTEXT_NODE
public short getTEXT_NODE() -
getCDATA_SECTION_NODE
public short getCDATA_SECTION_NODE() -
getENTITY_REFERENCE_NODE
public short getENTITY_REFERENCE_NODE() -
getENTITY_NODE
public short getENTITY_NODE() -
getPROCESSING_INSTRUCTION_NODE
public short getPROCESSING_INSTRUCTION_NODE() -
getCOMMENT_NODE
public short getCOMMENT_NODE() -
getDOCUMENT_NODE
public short getDOCUMENT_NODE() -
getDOCUMENT_TYPE_NODE
public short getDOCUMENT_TYPE_NODE() -
getDOCUMENT_FRAGMENT_NODE
public short getDOCUMENT_FRAGMENT_NODE() -
getNOTATION_NODE
public short getNOTATION_NODE() -
getDOCUMENT_POSITION_DISCONNECTED
public short getDOCUMENT_POSITION_DISCONNECTED() -
getDOCUMENT_POSITION_PRECEDING
public short getDOCUMENT_POSITION_PRECEDING() -
getDOCUMENT_POSITION_FOLLOWING
public short getDOCUMENT_POSITION_FOLLOWING() -
getDOCUMENT_POSITION_CONTAINS
public short getDOCUMENT_POSITION_CONTAINS() -
getDOCUMENT_POSITION_CONTAINED_BY
public short getDOCUMENT_POSITION_CONTAINED_BY() -
getDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
public short getDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC()
-