Package org.lobobrowser.html.domimpl
Class NodeImpl
java.lang.Object
org.lobobrowser.js.AbstractScriptableDelegate
org.lobobrowser.html.domimpl.NodeImpl
- All Implemented Interfaces:
ModelNode
,ScriptableDelegate
,Node
- Direct Known Subclasses:
AttrImpl
,CharacterDataImpl
,DocumentFragmentImpl
,DocumentTypeImpl
,ElementImpl
,HTMLDocumentImpl
,HTMLProcessingInstruction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Document
protected static final Logger
protected ArrayList
protected boolean
protected Node
protected Object
A tree lock is less deadlock-prone than a node-level lock.protected UINode
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendChild
(Node newChild) protected void
appendInnerHTMLImpl
(StringBuffer buffer) protected void
appendInnerTextImpl
(StringBuffer buffer) cloneNode
(boolean deep) short
compareDocumentPosition
(Node other) protected RenderState
createRenderState
(RenderState prevRenderState) protected abstract Node
Should create a node with some cloned properties, like the node name, but not attributes or children.boolean
equalAttributes
(Node arg) Tries to get a UINode associated with the current node.protected void
float
float
NodeImpl[]
getDescendents
(NodeFilter filter, boolean nestIntoMatchingNodes) Creates anArrayList
of descendent nodes that the given filter condition.getDocumentItem
(String name) getFeature
(String feature, String version) getFullURL
(String spec) Attempts to convert the subtree starting at this point to a close text representation.abstract String
protected NodeList
getNodeList
(NodeFilter filter) abstract String
abstract short
abstract String
final ModelNode
protected final RenderState
getParentRenderState
(Object parent) Gets the text content of this node and its descendents.getUserData
(String key) boolean
boolean
protected String
htmlEncodeChildText
(String text) void
protected void
void
void
void
protected void
void
void
void
insertAfter
(Node newChild, Node refChild) protected Node
insertBefore
(Node newChild, Node refChild) boolean
isDefaultNamespace
(String namespaceURI) boolean
isEqualNode
(Node arg) final boolean
isEqualOrDescendentOf
(ModelNode otherContext) boolean
isSameNode
(Node other) boolean
isSupported
(String feature, String version) lookupNamespaceURI
(String prefix) lookupPrefix
(String namespaceURI) void
protected void
protected void
removeChild
(Node oldChild) removeChildAt
(int index) protected void
removeChildren
(NodeFilter filter) protected void
removeChildrenImpl
(NodeFilter filter) replaceAdjacentTextNodes
(Text node) replaceAdjacentTextNodes
(Text node, String textContent) replaceChild
(Node newChild, Node oldChild) void
setDocumentItem
(String name, Object value) Sets a document item.abstract void
setNodeValue
(String nodeValue) void
void
setTextContent
(String textContent) void
setUserData
(String key, Object data, UserDataHandler handler) toString()
void
void
Methods inherited from class org.lobobrowser.js.AbstractScriptableDelegate
getScriptable, setScriptable
-
Field Details
-
logger
-
uiNode
-
nodeList
-
document
-
treeLock
A tree lock is less deadlock-prone than a node-level lock. This is assigned in setOwnerDocument. -
notificationsSuspended
protected volatile boolean notificationsSuspended -
parentNode
-
-
Constructor Details
-
NodeImpl
public NodeImpl()
-
-
Method Details
-
setUINode
-
getUINode
-
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. -
appendChild
- Specified by:
appendChild
in interfaceNode
- Throws:
DOMException
-
removeAllChildren
protected void removeAllChildren() -
removeAllChildrenImpl
protected void removeAllChildrenImpl() -
getNodeList
-
getChildrenArray
-
getChildren
-
getDescendents
Creates anArrayList
of descendent nodes that the given filter condition. -
createSimilarNode
Should create a node with some cloned properties, like the node name, but not attributes or children. -
cloneNode
-
compareDocumentPosition
- Specified by:
compareDocumentPosition
in interfaceNode
- Throws:
DOMException
-
getAttributes
- Specified by:
getAttributes
in interfaceNode
-
getOwnerDocument
- Specified by:
getOwnerDocument
in interfaceNode
-
insertBefore
- Specified by:
insertBefore
in interfaceNode
- Throws:
DOMException
-
insertAt
- Throws:
DOMException
-
replaceChild
- Specified by:
replaceChild
in interfaceNode
- Throws:
DOMException
-
removeChild
- Specified by:
removeChild
in interfaceNode
- Throws:
DOMException
-
removeChildAt
- Throws:
DOMException
-
hasChildNodes
public boolean hasChildNodes()- Specified by:
hasChildNodes
in interfaceNode
-
getBaseURI
- Specified by:
getBaseURI
in interfaceNode
-
getChildNodes
- Specified by:
getChildNodes
in interfaceNode
-
getFirstChild
- Specified by:
getFirstChild
in interfaceNode
-
getLastChild
- Specified by:
getLastChild
in interfaceNode
-
getPreviousSibling
- Specified by:
getPreviousSibling
in interfaceNode
-
getNextSibling
- Specified by:
getNextSibling
in interfaceNode
-
getFeature
- Specified by:
getFeature
in interfaceNode
-
setUserData
- Specified by:
setUserData
in interfaceNode
-
getUserData
- Specified by:
getUserData
in interfaceNode
-
getLocalName
- Specified by:
getLocalName
in interfaceNode
-
hasAttributes
public boolean hasAttributes()- Specified by:
hasAttributes
in interfaceNode
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceNode
-
getNodeName
- Specified by:
getNodeName
in interfaceNode
-
getNodeValue
- Specified by:
getNodeValue
in interfaceNode
- Throws:
DOMException
-
getPrefix
-
setPrefix
- Specified by:
setPrefix
in interfaceNode
- Throws:
DOMException
-
setNodeValue
- Specified by:
setNodeValue
in interfaceNode
- Throws:
DOMException
-
getNodeType
public abstract short getNodeType()- Specified by:
getNodeType
in interfaceNode
-
getTextContent
Gets the text content of this node and its descendents.- Specified by:
getTextContent
in interfaceNode
- Throws:
DOMException
-
setTextContent
- Specified by:
setTextContent
in interfaceNode
- Throws:
DOMException
-
removeChildren
-
removeChildrenImpl
-
insertAfter
-
replaceAdjacentTextNodes
-
replaceAdjacentTextNodes
-
getParentNode
- Specified by:
getParentNode
in interfaceNode
-
isSameNode
- Specified by:
isSameNode
in interfaceNode
-
isSupported
- Specified by:
isSupported
in interfaceNode
-
lookupNamespaceURI
- Specified by:
lookupNamespaceURI
in interfaceNode
-
equalAttributes
-
isEqualNode
- Specified by:
isEqualNode
in interfaceNode
-
isDefaultNamespace
- Specified by:
isDefaultNamespace
in interfaceNode
-
lookupPrefix
- Specified by:
lookupPrefix
in interfaceNode
-
normalize
public void normalize() -
toString
-
getUserAgentContext
-
getHtmlRendererContext
-
getAlignmentX
public float getAlignmentX() -
getAlignmentY
public float getAlignmentY() -
getFullURL
- Specified by:
getFullURL
in interfaceModelNode
- Throws:
MalformedURLException
-
getDocumentURL
-
getDocumentItem
- Specified by:
getDocumentItem
in interfaceModelNode
-
setDocumentItem
Description copied from interface:ModelNode
Sets a document item. A radio button, for example, can use this to set button group state.- Specified by:
setDocumentItem
in interfaceModelNode
-
isEqualOrDescendentOf
- Specified by:
isEqualOrDescendentOf
in interfaceModelNode
-
getParentModelNode
- Specified by:
getParentModelNode
in interfaceModelNode
-
warn
-
warn
-
informSizeInvalid
public void informSizeInvalid() -
informLookInvalid
public void informLookInvalid() -
informPositionInvalid
public void informPositionInvalid() -
informInvalid
public void informInvalid() -
informStructureInvalid
public void informStructureInvalid() -
informNodeLoaded
protected void informNodeLoaded() -
informExternalScriptLoading
protected void informExternalScriptLoading() -
informLayoutInvalid
public void informLayoutInvalid() -
informDocumentInvalid
public void informDocumentInvalid() -
getRenderState
- Specified by:
getRenderState
in interfaceModelNode
-
getParentRenderState
-
createRenderState
-
forgetRenderState
protected void forgetRenderState() -
getInnerHTML
-
appendInnerHTMLImpl
-
htmlEncodeChildText
-
getInnerText
Attempts to convert the subtree starting at this point to a close text representation. BR elements are converted to line breaks, and so forth. -
appendInnerTextImpl
-