org.lobobrowser.html.domimpl

Class ElementImpl

Implemented Interfaces:
Element, Node, ModelNode, ScriptableDelegate
Known Direct Subclasses:
HTMLElementImpl

public class ElementImpl
extends NodeImpl
implements Element

Field Summary

protected Map
attributes

Fields inherited from class org.lobobrowser.html.domimpl.NodeImpl

document, logger, nodeList, notificationsSuspended, parentNode, treeLock, uiNode

Constructor Summary

ElementImpl(String name)

Method Summary

protected void
appendInnerTextImpl(StringBuffer buffer)
protected void
assignAttributeField(String normalName, String value)
protected Node
createSimilarNode()
Should create a node with some cloned properties, like the node name, but not attributes or children.
boolean
equalAttributes(Node arg)
String
getAttribute(String name)
String
getAttributeNS(String namespaceURI, String localName)
Attr
getAttributeNode(String name)
Attr
getAttributeNodeNS(String namespaceURI, String localName)
NamedNodeMap
getAttributes()
String
getDir()
NodeList
getElementsByTagName(String name)
NodeList
getElementsByTagNameNS(String namespaceURI, String localName)
String
getId()
String
getInnerText()
Attempts to convert the subtree starting at this point to a close text representation.
String
getLang()
String
getLocalName()
String
getNodeName()
short
getNodeType()
String
getNodeValue()
protected String
getRawInnerText(boolean includeComment)
Gets inner text of the element, possibly including text in comments.
TypeInfo
getSchemaTypeInfo()
String
getTagName()
String
getTitle()
boolean
hasAttribute(String name)
boolean
hasAttributeNS(String namespaceURI, String localName)
boolean
hasAttributes()
protected static boolean
isTagName(Node node, String name)
protected String
normalizeAttributeName(String name)
void
removeAttribute(String name)
void
removeAttributeNS(String namespaceURI, String localName)
Attr
removeAttributeNode(Attr oldAttr)
void
setAttribute(String name, String value)
void
setAttributeImpl(String name, String value)
Fast method to set attributes.
void
setAttributeNS(String namespaceURI, String qualifiedName, String value)
Attr
setAttributeNode(Attr newAttr)
Attr
setAttributeNodeNS(Attr newAttr)
void
setDir(String dir)
void
setId(String id)
void
setIdAttribute(String name, boolean isId)
void
setIdAttributeNS(String namespaceURI, String localName, boolean isId)
void
setIdAttributeNode(Attr idAttr, boolean isId)
void
setInnerText(String newText)
void
setLang(String lang)
void
setNodeValue(String nodeValue)
void
setTitle(String title)
String
toString()

Methods inherited from class org.lobobrowser.html.domimpl.NodeImpl

appendChild, cloneNode, compareDocumentPosition, createRenderState, createSimilarNode, equalAttributes, findUINode, forgetRenderState, getAlignmentX, getAlignmentY, getAttributes, getBaseURI, getChildNodes, getChildren, getChildrenArray, getDescendents, getDocumentItem, getDocumentURL, getFeature, getFirstChild, getFullURL, getHtmlRendererContext, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeList, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentModelNode, getParentNode, getParentRenderState, getPrefix, getPreviousSibling, getRenderState, getTextContent, getUINode, getUserAgentContext, getUserData, hasAttributes, hasChildNodes, informExternalScriptLoading, informInvalid, informLayoutInvalid, informLookInvalid, informNodeLoaded, informPositionInvalid, informSizeInvalid, insertAfter, insertAt, insertBefore, isDefaultNamespace, isEqualNode, isEqualOrDescendentOf, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeAllChildren, removeAllChildrenImpl, removeChild, removeChildAt, removeChildren, removeChildrenImpl, replaceAdjacentTextNodes, replaceAdjacentTextNodes, replaceChild, setDocumentItem, setNodeValue, setPrefix, setTextContent, setUINode, setUserData, toString, warn, warn

Methods inherited from class org.lobobrowser.js.AbstractScriptableDelegate

getScriptable, setScriptable

Field Details

attributes

protected Map attributes

Constructor Details

ElementImpl

public ElementImpl(String name)

Method Details

appendInnerTextImpl

protected void appendInnerTextImpl(StringBuffer buffer)

assignAttributeField

protected void assignAttributeField(String normalName,
                                    String value)

createSimilarNode

protected Node createSimilarNode()
Should create a node with some cloned properties, like the node name, but not attributes or children.
Overrides:
createSimilarNode in interface NodeImpl

equalAttributes

public boolean equalAttributes(Node arg)
Overrides:
equalAttributes in interface NodeImpl

getAttribute

public final String getAttribute(String name)

getAttributeNS

public String getAttributeNS(String namespaceURI,
                             String localName)
            throws DOMException

getAttributeNode

public Attr getAttributeNode(String name)

getAttributeNodeNS

public Attr getAttributeNodeNS(String namespaceURI,
                               String localName)
            throws DOMException

getAttributes

public NamedNodeMap getAttributes()
Overrides:
getAttributes in interface NodeImpl

getDir

public String getDir()

getElementsByTagName

public NodeList getElementsByTagName(String name)

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespaceURI,
                                       String localName)
            throws DOMException

getId

public String getId()

getInnerText

public String 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.

getLang

public String getLang()

getLocalName

public String getLocalName()
Overrides:
getLocalName in interface NodeImpl

getNodeName

public String getNodeName()
Overrides:
getNodeName in interface NodeImpl

getNodeType

public short getNodeType()
Overrides:
getNodeType in interface NodeImpl

getNodeValue

public String getNodeValue()
            throws DOMException
Overrides:
getNodeValue in interface NodeImpl

getRawInnerText

protected String getRawInnerText(boolean includeComment)
Gets inner text of the element, possibly including text in comments. This can be used to get Javascript code out of a SCRIPT element.
Parameters:
includeComment -

getSchemaTypeInfo

public TypeInfo getSchemaTypeInfo()

getTagName

public String getTagName()

getTitle

public String getTitle()

hasAttribute

public boolean hasAttribute(String name)

hasAttributeNS

public boolean hasAttributeNS(String namespaceURI,
                              String localName)
            throws DOMException

hasAttributes

public boolean hasAttributes()
Overrides:
hasAttributes in interface NodeImpl

isTagName

protected static boolean isTagName(Node node,
                                   String name)

normalizeAttributeName

protected final String normalizeAttributeName(String name)

removeAttribute

public void removeAttribute(String name)
            throws DOMException

removeAttributeNS

public void removeAttributeNS(String namespaceURI,
                              String localName)
            throws DOMException

removeAttributeNode

public Attr removeAttributeNode(Attr oldAttr)
            throws DOMException

setAttribute

public void setAttribute(String name,
                         String value)
            throws DOMException

setAttributeImpl

public void setAttributeImpl(String name,
                             String value)
            throws DOMException
Fast method to set attributes. It is not thread safe. Calling thread should hold a treeLock.

setAttributeNS

public void setAttributeNS(String namespaceURI,
                           String qualifiedName,
                           String value)
            throws DOMException

setAttributeNode

public Attr setAttributeNode(Attr newAttr)
            throws DOMException

setAttributeNodeNS

public Attr setAttributeNodeNS(Attr newAttr)
            throws DOMException

setDir

public void setDir(String dir)

setId

public void setId(String id)

setIdAttribute

public void setIdAttribute(String name,
                           boolean isId)
            throws DOMException

setIdAttributeNS

public void setIdAttributeNS(String namespaceURI,
                             String localName,
                             boolean isId)
            throws DOMException

setIdAttributeNode

public void setIdAttributeNode(Attr idAttr,
                               boolean isId)
            throws DOMException

setInnerText

public void setInnerText(String newText)

setLang

public void setLang(String lang)

setNodeValue

public void setNodeValue(String nodeValue)
            throws DOMException
Overrides:
setNodeValue in interface NodeImpl

setTitle

public void setTitle(String title)

toString

public String toString()
Overrides:
toString in interface NodeImpl