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
Modifier and TypeFieldDescriptionprotected Document
protected final NodeListImpl
protected boolean
protected Node
protected UINode
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionappendChild
(Node newChild) appendChild.protected void
appendInnerHTMLImpl
(StringBuilder buffer) appendInnerHTMLImpl.protected void
appendInnerTextImpl
(StringBuilder buffer) appendInnerTextImpl.clone()
cloneNode.cloneNode
(boolean deep) Returns a copy of node.short
compareDocumentPosition
(Node other) compareDocumentPosition.boolean
Returns true if other is an inclusive descendant of node, and false otherwise.protected RenderState
createRenderState
(RenderState prevRenderState) createRenderState.Tries to get a UINode associated with the current node.protected void
forgetRenderState.short
getAttributes.Returns node's node document's document base URL.short
int
getChildIndex
(Node child) getChildIndex.Returns the children.getChildren.short
getDescendents
(NodeFilter filter, boolean nestIntoMatchingNodes) Creates an NodeList of descendent nodes that the given filter condition.short
short
short
short
short
short
short
short
short
getDocumentItem
(String name) getDocumentItem.getDocumentNode.getDocumentURL.short
short
short
getFeature
(String feature, String version) Returns the first child.getFirstChildByFilter
(NodeFilter filter) getFirstChildByFilter.getFullURL
(String spec) getFullURL.getHtmlRendererContext.getHtmlRendererContext.Returns the last child.abstract String
getLocalName.getNamespaceURI.getNextElementSibling.Returns the next sibling.getNodeList
(NodeFilter filter) Getter for the field nodeList.abstract String
Returns a string appropriate for the type of node.abstract int
Returns the type of node.abstract String
getNodeValue.short
getNONE()
short
Returns the node document.Returns the parent element.final ModelNode
getParentModelNode.Returns the parent.protected final RenderState
getParentRenderState
(Object parent) getParentRenderState.Returns prefix.getPreviousElementSibling.Returns the previous sibling.short
getRenderState.Returns node's root.short
getTextContent.getUINode.getUserAgentContext.getUserData
(String key) getUserData.boolean
Returns whether node has children.protected String
htmlEncodeChildText
(String text) htmlEncodeChildText.void
informInvalid.void
informLayoutInvalid.void
informLookInvalid.protected void
informNodeLoaded.void
informPositionInvalid.void
informSizeInvalid.void
informStructureInvalid.insertAfter
(Node newChild, Node refChild) insertAfter.protected Node
insertAt.insertBefore
(Node newChild, Node refChild) insertBefore.boolean
isDefaultNamespace
(String namespaceURI) isDefaultNamespace.boolean
isEqualNode
(Node arg) Returns whether node and otherNode have the same properties.final boolean
isEqualOrDescendentOf
(ModelNode otherContext) isEqualOrDescendentOf.boolean
Returns true if node is connected and false otherwise.boolean
isSameNode
(Node other) isSameNode.boolean
isSupported
(String feature, String version) lookupNamespaceURI
(String prefix) lookupNamespaceURI.lookupPrefix
(String namespaceURI) lookupPrefix.void
Removes 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 void
removeChildrenImpl
(NodeFilter filter) removeChildrenImpl.protected void
removeTableChildren
(NodeFilter filter) removeChildren.replaceAdjacentTextNodes
(Text node, String textContent) replaceAdjacentTextNodes.replaceChild
(Node newChild, Node oldChild) replaceChild.void
setDocumentItem
(String name, Object value) Sets a document item.abstract void
setNodeValue
(String nodeValue) setNodeValue.void
setOwnerDocument
(Document value) setOwnerDocument.void
setOwnerDocument
(Document value, boolean deep) setOwnerDocument.final void
setParentImpl
(Node parent) setParentImpl.void
setPrefix.void
setTextContent
(String textContent) setTextContent.void
setUINode.setUserData
(String key, Object data, UserDataHandler handler) setUserData.toString()
void
visit
(NodeVisitor visitor) visit.protected void
visitImpl
(NodeVisitor visitor) visitImpl.void
warn.void
warn.Methods inherited from class org.loboevolution.html.dom.nodeimpl.event.EventTargetImpl
addEventListener, addEventListener, dispatchEvent, dispatchEvent, getFunction, removeEventListener, removeEventListener
Methods inherited from class org.loboevolution.js.AbstractScriptableDelegate
getScriptable, setScriptable
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.loboevolution.events.EventTarget
addEventListener, addEventListener, dispatchEvent, dispatchEvent, removeEventListener, removeEventListener
Methods inherited from interface org.loboevolution.html.node.Node
hasAttributes
-
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:
appendChild
in interfaceNode
- Parameters:
newChild
- aNode
object.- Returns:
- a
Node
object.
-
prependChild
prependChild.
- Specified by:
prependChild
in interfaceNode
- Parameters:
newChild
- aNode
object.- Returns:
- a
Node
object.
-
prepend
prepend.
-
appendInnerHTMLImpl
appendInnerHTMLImpl.
- Parameters:
buffer
- aStringBuilder
object.
-
appendInnerTextImpl
appendInnerTextImpl.
- Parameters:
buffer
- aStringBuilder
object.
-
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:
isSupported
in interfaceNode
-
compareDocumentPosition
compareDocumentPosition.
- Specified by:
compareDocumentPosition
in interfaceNode
- Parameters:
other
- aNode
object.- Returns:
- a short.
-
createRenderState
createRenderState.
- Parameters:
prevRenderState
- aRenderState
object.- Returns:
- a
RenderState
object.
-
getAttributes
Description copied from interface:Node
getAttributes.
- Specified by:
getAttributes
in interfaceNode
- Returns:
- a
NamedNodeMap
object.
-
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.- Returns:
- a
UINode
object.
-
forgetRenderState
protected void forgetRenderState()forgetRenderState.
-
getBaseURI
Returns node's node document's document base URL.- Specified by:
getBaseURI
in interfaceNode
- Returns:
- a
String
object.
-
getChildIndex
getChildIndex.
-
getChildNodes
Returns the children.- Specified by:
getChildNodes
in interfaceNode
- Returns:
- a
NodeList
object.
-
getChildren
getChildren.
- Returns:
- a
HTMLCollection
object.
-
getDescendents
Creates an NodeList of descendent nodes that the given filter condition.- Parameters:
filter
- aNodeFilter
object.nestIntoMatchingNodes
- a boolean.- Returns:
- a
NodeList
object.
-
getDocumentItem
getDocumentItem.
- Specified by:
getDocumentItem
in interfaceModelNode
- Parameters:
name
- aString
object.- Returns:
- a
Object
object.
-
getDocumentURL
getDocumentURL.
- Returns:
- a
URL
object.
-
getFirstChild
Returns the first child.- Specified by:
getFirstChild
in interfaceNode
- Returns:
- a
Node
object.
-
getFirstChildByFilter
getFirstChildByFilter.
- Parameters:
filter
- aNodeFilter
object.- Returns:
- a
Node
object.
-
getFullURL
getFullURL.
- Specified by:
getFullURL
in interfaceModelNode
- Parameters:
spec
- aString
object.- Returns:
- a
URL
object. - Throws:
Exception
- if any.
-
getHtmlRendererContext
getHtmlRendererContext.
- Returns:
- a
HtmlRendererContext
object.
-
getHtmlRendererConfig
getHtmlRendererContext.
- Returns:
- a
HtmlRendererConfig
object.
-
getLastChild
Returns the last child.- Specified by:
getLastChild
in interfaceNode
- Returns:
- a
Node
object.
-
getLocalName
getLocalName.
- Specified by:
getLocalName
in interfaceNode
- Returns:
- a
String
object.
-
getNamespaceURI
getNamespaceURI.
- Specified by:
getNamespaceURI
in interfaceNode
- Returns:
- a
String
object.
-
getNextSibling
Returns the next sibling.- Specified by:
getNextSibling
in interfaceNode
- Returns:
- a
Node
object.
-
getNextElementSibling
getNextElementSibling.
- Returns:
- a
Element
object.
-
getNodeList
Getter for the field nodeList.
- Parameters:
filter
- aNodeFilter
object.- Returns:
- a
NodeList
object.
-
getNodeName
Returns a string appropriate for the type of node.- Specified by:
getNodeName
in interfaceNode
- Returns:
- a
String
object.
-
getNodeType
public abstract int getNodeType()Returns the type of node.- Specified by:
getNodeType
in interfaceNode
- Returns:
- a
Integer
object.
-
getNodeValue
getNodeValue.
- Specified by:
getNodeValue
in interfaceNode
- Returns:
- a
String
object. - Throws:
DOMException
-
getOwnerDocument
Returns the node document. Returns null for documents.- Specified by:
getOwnerDocument
in interfaceNode
- Returns:
- a
Document
object.
-
getParentModelNode
getParentModelNode.
- Specified by:
getParentModelNode
in interfaceModelNode
- Returns:
- a
ModelNode
object.
-
getParentNode
Returns the parent.- Specified by:
getParentNode
in interfaceNode
- Returns:
- a
Node
object.
-
getParentElement
Returns the parent element.- Specified by:
getParentElement
in interfaceNode
- Returns:
- a
HTMLElement
object.
-
getParentRenderState
getParentRenderState.
- Parameters:
parent
- aObject
object.- Returns:
- a
RenderState
object.
-
getPrefix
Returns prefix. -
getPreviousSibling
Returns the previous sibling.- Specified by:
getPreviousSibling
in interfaceNode
- Returns:
- a
Node
object.
-
getPreviousElementSibling
getPreviousElementSibling.
- Returns:
- a
Element
object.
-
getRenderState
getRenderState.
- Specified by:
getRenderState
in interfaceModelNode
- Returns:
- a
RenderState
object.
-
getTextContent
getTextContent.
Gets the text content of this node and its descendents.- Specified by:
getTextContent
in interfaceNode
- Returns:
- a
String
object.
-
getUINode
getUINode.
- Returns:
- a
UINode
object.
-
getUserAgentContext
getUserAgentContext.
- Returns:
- a
UserAgentContext
object.
-
getUserData
getUserData.
- Specified by:
getUserData
in interfaceNode
- Parameters:
key
- aString
object.- Returns:
- a
Object
object.
-
hasChildNodes
public boolean hasChildNodes()Returns whether node has children.- Specified by:
hasChildNodes
in 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.
- Returns:
- the document
-
insertAfter
insertAfter.
-
insertAt
insertAt.
- Parameters:
newChild
- aNode
object.idx
- aInteger
object.- Returns:
- a
Node
object. - Throws:
DOMException
- if any.
-
insertBefore
insertBefore.
- Specified by:
insertBefore
in interfaceNode
- Parameters:
newChild
- aNode
object.refChild
- aNode
object.- Returns:
- a
Node
object.
-
isDefaultNamespace
isDefaultNamespace.
- Specified by:
isDefaultNamespace
in interfaceNode
- Parameters:
namespaceURI
- aString
object.- Returns:
- a boolean.
-
isEqualNode
Returns whether node and otherNode have the same properties.- Specified by:
isEqualNode
in interfaceNode
- Parameters:
arg
- aNode
object.- Returns:
- a boolean.
-
isEqualOrDescendentOf
isEqualOrDescendentOf.
- Specified by:
isEqualOrDescendentOf
in interfaceModelNode
- Parameters:
otherContext
- aModelNode
object.- Returns:
- a boolean.
-
isSameNode
isSameNode.
- Specified by:
isSameNode
in interfaceNode
- Parameters:
other
- aNode
object.- Returns:
- a boolean.
-
lookupNamespaceURI
lookupNamespaceURI.
- Specified by:
lookupNamespaceURI
in interfaceNode
- Parameters:
prefix
- aString
object.- Returns:
- a
String
object.
-
lookupPrefix
lookupPrefix.
- Specified by:
lookupPrefix
in interfaceNode
- Parameters:
namespaceURI
- aString
object.- Returns:
- a
String
object.
-
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:
removeChild
in interfaceNode
- Parameters:
oldChild
- aNode
object.- Returns:
- a
Node
object.
-
removeChildAt
removeChildAt.
- Parameters:
index
- aInteger
object.- Returns:
- a
Node
object. - Throws:
DOMException
- if any.
-
removeTableChildren
removeChildren.
- Parameters:
filter
- aNodeFilter
object.
-
removeChildrenImpl
removeChildrenImpl.
- Parameters:
filter
- aNodeFilter
object.
-
replaceAdjacentTextNodes
replaceAdjacentTextNodes.
-
replaceChild
replaceChild.
- Specified by:
replaceChild
in interfaceNode
- Parameters:
newChild
- aNode
object.oldChild
- aNode
object.- Returns:
- a
Node
object.
-
setDocumentItem
Sets a document item. A radio button, for example, can use this to set button group state.- Specified by:
setDocumentItem
in interfaceModelNode
- Parameters:
name
- aString
object.value
- aObject
object.
-
setNodeValue
setNodeValue.
- Specified by:
setNodeValue
in interfaceNode
- Parameters:
nodeValue
- aString
object.- Throws:
DOMException
-
setOwnerDocument
setOwnerDocument.
- Specified by:
setOwnerDocument
in interfaceNode
- Parameters:
value
- aDocument
object.
-
setOwnerDocument
setOwnerDocument.
- Parameters:
value
- aDocument
object.deep
- a boolean.
-
setParentImpl
setParentImpl.
- Parameters:
parent
- aNode
object.
-
setPrefix
setPrefix.
- Specified by:
setPrefix
in interfaceNode
- Parameters:
prefix
- aString
object.- Throws:
DOMException
-
setTextContent
setTextContent.
- Specified by:
setTextContent
in interfaceNode
- Parameters:
textContent
- aString
object.
-
setUINode
setUINode.
- Parameters:
uiNode
- aUINode
object.
-
setUserData
setUserData.
- Specified by:
setUserData
in interfaceNode
- Parameters:
key
- aString
object.data
- aObject
object.handler
- aUserDataHandler
object.- Returns:
- a
Object
object.
-
isIsConnected
public boolean isIsConnected()Returns true if node is connected and false otherwise.- Specified by:
isIsConnected
in interfaceNode
- Returns:
- a boolean.
-
getRootNode
Returns node's root.- Specified by:
getRootNode
in interfaceNode
- Returns:
- a
Node
object.
-
getFeature
- Specified by:
getFeature
in interfaceNode
-
toString
-
visit
visit.
- Parameters:
visitor
- aNodeVisitor
object.
-
visitImpl
visitImpl.
- Parameters:
visitor
- aNodeVisitor
object.
-
warn
warn.
- Parameters:
message
- aString
object.
-
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()
-