org.lobobrowser.html.domimpl

Class NodeImpl

Implemented Interfaces:
Node, ModelNode, ScriptableDelegate
Known Direct Subclasses:
AttrImpl, CharacterDataImpl, DocumentFragmentImpl, DocumentTypeImpl, ElementImpl, HTMLDocumentImpl

public abstract class NodeImpl
extends AbstractScriptableDelegate
implements Node, ModelNode

Field Summary

protected Document
document
protected static Logger
logger
protected ArrayList
nodeList
protected boolean
notificationsSuspended
protected Node
parentNode
protected Object
treeLock
A tree lock is less deadlock-prone than a node-level lock.
protected UINode
uiNode

Constructor Summary

NodeImpl()

Method Summary

Node
appendChild(Node newChild)
Node
cloneNode(boolean deep)
short
compareDocumentPosition(Node other)
protected RenderState
createRenderState(RenderState prevRenderState)
protected abstract Node
createSimilarNode()
Should create a node with some cloned properties, like the node name, but not attributes or children.
boolean
equalAttributes(Node arg)
UINode
findUINode()
Tries to get a UINode associated with the current node.
protected void
forgetRenderState()
float
getAlignmentX()
float
getAlignmentY()
NamedNodeMap
getAttributes()
String
getBaseURI()
NodeList
getChildNodes()
ChildHTMLCollection
getChildren()
NodeImpl[]
getChildrenArray()
ArrayList
getDescendents(NodeFilter filter)
Gets descendent nodes that match according to the filter, but it does not nest into matching nodes.
Object
getDocumentItem(String name)
URL
getDocumentURL()
Object
getFeature(String feature, String version)
Node
getFirstChild()
URL
getFullURL(String spec)
HtmlRendererContext
getHtmlRendererContext()
Node
getLastChild()
abstract String
getLocalName()
String
getNamespaceURI()
Node
getNextSibling()
protected NodeList
getNodeList(NodeFilter filter)
abstract String
getNodeName()
abstract short
getNodeType()
abstract String
getNodeValue()
Document
getOwnerDocument()
ModelNode
getParentModelNode()
Node
getParentNode()
protected RenderState
getParentRenderState(Object parent)
String
getPrefix()
Node
getPreviousSibling()
RenderState
getRenderState()
String
getTextContent()
Gets the text content of this node and its descendents.
UINode
getUINode()
UserAgentContext
getUserAgentContext()
Object
getUserData(String key)
boolean
hasAttributes()
boolean
hasChildNodes()
protected void
informExternalScriptLoading()
void
informInvalid()
void
informLayoutInvalid()
void
informLookInvalid()
protected void
informNodeLoaded()
void
informPositionInvalid()
void
informSizeInvalid()
Node
insertAfter(Node newChild, Node refChild)
protected Node
insertAt(Node newChild, int idx)
Node
insertBefore(Node newChild, Node refChild)
boolean
isDefaultNamespace(String namespaceURI)
boolean
isEqualNode(Node arg)
boolean
isEqualOrDescendentOf(ModelNode otherContext)
boolean
isSameNode(Node other)
boolean
isSupported(String feature, String version)
String
lookupNamespaceURI(String prefix)
String
lookupPrefix(String namespaceURI)
void
normalize()
protected void
removeAllChildren()
protected void
removeAllChildrenImpl()
Node
removeChild(Node oldChild)
Node
removeChildAt(int index)
protected void
removeChildren(NodeFilter filter)
protected void
removeChildrenImpl(NodeFilter filter)
Text
replaceAdjacentTextNodes(Text node)
Text
replaceAdjacentTextNodes(Text node, String textContent)
Node
replaceChild(Node newChild, Node oldChild)
void
setDocumentItem(String name, Object value)
abstract void
setNodeValue(String nodeValue)
void
setPrefix(String prefix)
void
setTextContent(String textContent)
void
setUINode(UINode uiNode)
Object
setUserData(String key, Object data, UserDataHandler handler)
String
toString()
void
warn(String message)
void
warn(String message, Throwable err)

Methods inherited from class org.lobobrowser.js.AbstractScriptableDelegate

getScriptable, setScriptable

Field Details

document

protected Document document

logger

protected static final Logger logger

nodeList

protected ArrayList nodeList

notificationsSuspended

protected boolean notificationsSuspended

parentNode

protected Node parentNode

treeLock

protected Object treeLock
A tree lock is less deadlock-prone than a node-level lock. This is assigned in setOwnerDocument.

uiNode

protected UINode uiNode

Constructor Details

NodeImpl

public NodeImpl()

Method Details

appendChild

public Node appendChild(Node newChild)
            throws DOMException

cloneNode

public Node cloneNode(boolean deep)

compareDocumentPosition

public short compareDocumentPosition(Node other)
            throws DOMException

createRenderState

protected RenderState createRenderState(RenderState prevRenderState)

createSimilarNode

protected abstract Node createSimilarNode()
Should create a node with some cloned properties, like the node name, but not attributes or children.

equalAttributes

public boolean equalAttributes(Node arg)

findUINode

public UINode findUINode()
Tries to get a UINode associated with the current node. Failing that, it tries ancestors recursively.

forgetRenderState

protected void forgetRenderState()

getAlignmentX

public float getAlignmentX()

getAlignmentY

public float getAlignmentY()

getAttributes

public NamedNodeMap getAttributes()

getBaseURI

public String getBaseURI()

getChildNodes

public NodeList getChildNodes()

getChildren

public ChildHTMLCollection getChildren()

getChildrenArray

public NodeImpl[] getChildrenArray()

getDescendents

public ArrayList getDescendents(NodeFilter filter)
Gets descendent nodes that match according to the filter, but it does not nest into matching nodes.

getDocumentItem

public Object getDocumentItem(String name)
Specified by:
getDocumentItem in interface ModelNode

getDocumentURL

public URL getDocumentURL()

getFeature

public Object getFeature(String feature,
                         String version)

getFirstChild

public Node getFirstChild()

getFullURL

public URL getFullURL(String spec)
            throws MalformedURLException
Specified by:
getFullURL in interface ModelNode

getHtmlRendererContext

public HtmlRendererContext getHtmlRendererContext()

getLastChild

public Node getLastChild()

getLocalName

public abstract String getLocalName()

getNamespaceURI

public String getNamespaceURI()

getNextSibling

public Node getNextSibling()

getNodeList

protected NodeList getNodeList(NodeFilter filter)

getNodeName

public abstract String getNodeName()

getNodeType

public abstract short getNodeType()

getNodeValue

public abstract String getNodeValue()
            throws DOMException

getOwnerDocument

public Document getOwnerDocument()

getParentModelNode

public final ModelNode getParentModelNode()
Specified by:
getParentModelNode in interface ModelNode

getParentNode

public Node getParentNode()

getParentRenderState

protected final RenderState getParentRenderState(Object parent)

getPrefix

public String getPrefix()

getPreviousSibling

public Node getPreviousSibling()

getRenderState

public RenderState getRenderState()
Specified by:
getRenderState in interface ModelNode

getTextContent

public String getTextContent()
            throws DOMException
Gets the text content of this node and its descendents.

getUINode

public UINode getUINode()

getUserAgentContext

public UserAgentContext getUserAgentContext()

getUserData

public Object getUserData(String key)

hasAttributes

public boolean hasAttributes()

hasChildNodes

public boolean hasChildNodes()

informExternalScriptLoading

protected void informExternalScriptLoading()

informInvalid

public void informInvalid()

informLayoutInvalid

public void informLayoutInvalid()

informLookInvalid

public void informLookInvalid()

informNodeLoaded

protected void informNodeLoaded()

informPositionInvalid

public void informPositionInvalid()

informSizeInvalid

public void informSizeInvalid()

insertAfter

public Node insertAfter(Node newChild,
                        Node refChild)

insertAt

protected Node insertAt(Node newChild,
                        int idx)
            throws DOMException

insertBefore

public Node insertBefore(Node newChild,
                         Node refChild)
            throws DOMException

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)

isEqualNode

public boolean isEqualNode(Node arg)

isEqualOrDescendentOf

public final boolean isEqualOrDescendentOf(ModelNode otherContext)
Specified by:
isEqualOrDescendentOf in interface ModelNode

isSameNode

public boolean isSameNode(Node other)

isSupported

public boolean isSupported(String feature,
                           String version)

lookupNamespaceURI

public String lookupNamespaceURI(String prefix)

lookupPrefix

public String lookupPrefix(String namespaceURI)

normalize

public void normalize()

removeAllChildren

protected void removeAllChildren()

removeAllChildrenImpl

protected void removeAllChildrenImpl()

removeChild

public Node removeChild(Node oldChild)
            throws DOMException

removeChildAt

public Node removeChildAt(int index)
            throws DOMException

removeChildren

protected void removeChildren(NodeFilter filter)

removeChildrenImpl

protected void removeChildrenImpl(NodeFilter filter)

replaceAdjacentTextNodes

public Text replaceAdjacentTextNodes(Text node)

replaceAdjacentTextNodes

public Text replaceAdjacentTextNodes(Text node,
                                     String textContent)

replaceChild

public Node replaceChild(Node newChild,
                         Node oldChild)
            throws DOMException

setDocumentItem

public void setDocumentItem(String name,
                            Object value)
Specified by:
setDocumentItem in interface ModelNode

setNodeValue

public abstract void setNodeValue(String nodeValue)
            throws DOMException

setPrefix

public void setPrefix(String prefix)
            throws DOMException

setTextContent

public void setTextContent(String textContent)
            throws DOMException

setUINode

public void setUINode(UINode uiNode)

setUserData

public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler)

toString

public String toString()

warn

public void warn(String message)

warn

public void warn(String message,
                 Throwable err)
Specified by:
warn in interface ModelNode