Package org.lobobrowser.html.domimpl
Class ElementImpl
- java.lang.Object
-
- org.lobobrowser.js.AbstractScriptableDelegate
-
- org.lobobrowser.html.domimpl.NodeImpl
-
- org.lobobrowser.html.domimpl.ElementImpl
-
- All Implemented Interfaces:
ModelNode
,ScriptableDelegate
,org.w3c.dom.Element
,org.w3c.dom.Node
- Direct Known Subclasses:
HTMLElementImpl
public class ElementImpl extends NodeImpl implements org.w3c.dom.Element
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map
attributes
-
Fields inherited from class org.lobobrowser.html.domimpl.NodeImpl
document, logger, nodeList, notificationsSuspended, parentNode, treeLock, 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 Constructor Description ElementImpl(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
assignAttributeField(java.lang.String normalName, java.lang.String value)
protected org.w3c.dom.Node
createSimilarNode()
Should create a node with some cloned properties, like the node name, but not attributes or children.boolean
equalAttributes(org.w3c.dom.Node arg)
java.lang.String
getAttribute(java.lang.String name)
org.w3c.dom.Attr
getAttributeNode(java.lang.String name)
org.w3c.dom.Attr
getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
java.lang.String
getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
org.w3c.dom.NamedNodeMap
getAttributes()
java.lang.String
getDir()
org.w3c.dom.NodeList
getElementsByTagName(java.lang.String name)
org.w3c.dom.NodeList
getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
java.lang.String
getId()
java.lang.String
getLang()
java.lang.String
getLocalName()
java.lang.String
getNodeName()
short
getNodeType()
java.lang.String
getNodeValue()
protected java.lang.String
getRawInnerText(boolean includeComment)
Gets inner text of the element, possibly including text in comments.org.w3c.dom.TypeInfo
getSchemaTypeInfo()
java.lang.String
getTagName()
java.lang.String
getTitle()
boolean
hasAttribute(java.lang.String name)
boolean
hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
boolean
hasAttributes()
protected java.lang.String
htmlEncodeChildText(java.lang.String text)
protected static boolean
isTagName(org.w3c.dom.Node node, java.lang.String name)
protected java.lang.String
normalizeAttributeName(java.lang.String name)
void
removeAttribute(java.lang.String name)
org.w3c.dom.Attr
removeAttributeNode(org.w3c.dom.Attr oldAttr)
void
removeAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
void
setAttribute(java.lang.String name, java.lang.String value)
void
setAttributeImpl(java.lang.String name, java.lang.String value)
Fast method to set attributes.org.w3c.dom.Attr
setAttributeNode(org.w3c.dom.Attr newAttr)
org.w3c.dom.Attr
setAttributeNodeNS(org.w3c.dom.Attr newAttr)
void
setAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value)
void
setDir(java.lang.String dir)
void
setId(java.lang.String id)
void
setIdAttribute(java.lang.String name, boolean isId)
void
setIdAttributeNode(org.w3c.dom.Attr idAttr, boolean isId)
void
setIdAttributeNS(java.lang.String namespaceURI, java.lang.String localName, boolean isId)
void
setInnerText(java.lang.String newText)
void
setLang(java.lang.String lang)
void
setNodeValue(java.lang.String nodeValue)
void
setTitle(java.lang.String title)
java.lang.String
toString()
-
Methods inherited from class org.lobobrowser.html.domimpl.NodeImpl
appendChild, appendInnerHTMLImpl, appendInnerTextImpl, cloneNode, compareDocumentPosition, createRenderState, findUINode, forgetRenderState, getAlignmentX, getAlignmentY, getBaseURI, getChildNodes, getChildren, getChildrenArray, getDescendents, getDocumentItem, getDocumentURL, getFeature, getFirstChild, getFullURL, getHtmlRendererContext, getInnerHTML, getInnerText, getLastChild, getNamespaceURI, getNextSibling, getNodeList, getOwnerDocument, getParentModelNode, getParentNode, getParentRenderState, getPrefix, getPreviousSibling, getRenderState, getTextContent, getUINode, getUserAgentContext, getUserData, hasChildNodes, informDocumentInvalid, informExternalScriptLoading, informInvalid, informLayoutInvalid, informLookInvalid, informNodeLoaded, informPositionInvalid, informSizeInvalid, informStructureInvalid, insertAfter, insertAt, insertBefore, isDefaultNamespace, isEqualNode, isEqualOrDescendentOf, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeAllChildren, removeAllChildrenImpl, removeChild, removeChildAt, removeChildren, removeChildrenImpl, replaceAdjacentTextNodes, replaceAdjacentTextNodes, replaceChild, setDocumentItem, setPrefix, setTextContent, setUINode, setUserData, warn, warn
-
Methods inherited from class org.lobobrowser.js.AbstractScriptableDelegate
getScriptable, setScriptable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setPrefix, setTextContent, setUserData
-
-
-
-
Method Detail
-
getAttributes
public org.w3c.dom.NamedNodeMap getAttributes()
- Specified by:
getAttributes
in interfaceorg.w3c.dom.Node
- Overrides:
getAttributes
in classNodeImpl
-
hasAttributes
public boolean hasAttributes()
- Specified by:
hasAttributes
in interfaceorg.w3c.dom.Node
- Overrides:
hasAttributes
in classNodeImpl
-
equalAttributes
public boolean equalAttributes(org.w3c.dom.Node arg)
- Overrides:
equalAttributes
in classNodeImpl
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
getTitle
public java.lang.String getTitle()
-
setTitle
public void setTitle(java.lang.String title)
-
getLang
public java.lang.String getLang()
-
setLang
public void setLang(java.lang.String lang)
-
getDir
public java.lang.String getDir()
-
setDir
public void setDir(java.lang.String dir)
-
getAttribute
public final java.lang.String getAttribute(java.lang.String name)
- Specified by:
getAttribute
in interfaceorg.w3c.dom.Element
-
getAttributeNode
public org.w3c.dom.Attr getAttributeNode(java.lang.String name)
- Specified by:
getAttributeNode
in interfaceorg.w3c.dom.Element
-
getAttributeNodeNS
public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName) throws org.w3c.dom.DOMException
- Specified by:
getAttributeNodeNS
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
getAttributeNS
public java.lang.String getAttributeNS(java.lang.String namespaceURI, java.lang.String localName) throws org.w3c.dom.DOMException
- Specified by:
getAttributeNS
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
isTagName
protected static boolean isTagName(org.w3c.dom.Node node, java.lang.String name)
-
getElementsByTagName
public org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
- Specified by:
getElementsByTagName
in interfaceorg.w3c.dom.Element
-
getElementsByTagNameNS
public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName) throws org.w3c.dom.DOMException
- Specified by:
getElementsByTagNameNS
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
getSchemaTypeInfo
public org.w3c.dom.TypeInfo getSchemaTypeInfo()
- Specified by:
getSchemaTypeInfo
in interfaceorg.w3c.dom.Element
-
getTagName
public java.lang.String getTagName()
- Specified by:
getTagName
in interfaceorg.w3c.dom.Element
-
hasAttribute
public boolean hasAttribute(java.lang.String name)
- Specified by:
hasAttribute
in interfaceorg.w3c.dom.Element
-
hasAttributeNS
public boolean hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName) throws org.w3c.dom.DOMException
- Specified by:
hasAttributeNS
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
removeAttribute
public void removeAttribute(java.lang.String name) throws org.w3c.dom.DOMException
- Specified by:
removeAttribute
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
removeAttributeNode
public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr) throws org.w3c.dom.DOMException
- Specified by:
removeAttributeNode
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
removeAttributeNS
public void removeAttributeNS(java.lang.String namespaceURI, java.lang.String localName) throws org.w3c.dom.DOMException
- Specified by:
removeAttributeNS
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
assignAttributeField
protected void assignAttributeField(java.lang.String normalName, java.lang.String value)
-
normalizeAttributeName
protected final java.lang.String normalizeAttributeName(java.lang.String name)
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.String value) throws org.w3c.dom.DOMException
- Specified by:
setAttribute
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
setAttributeImpl
public void setAttributeImpl(java.lang.String name, java.lang.String value) throws org.w3c.dom.DOMException
Fast method to set attributes. It is not thread safe. Calling thread should hold a treeLock.- Throws:
org.w3c.dom.DOMException
-
setAttributeNode
public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr) throws org.w3c.dom.DOMException
- Specified by:
setAttributeNode
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
setAttributeNodeNS
public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr) throws org.w3c.dom.DOMException
- Specified by:
setAttributeNodeNS
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
setAttributeNS
public void setAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value) throws org.w3c.dom.DOMException
- Specified by:
setAttributeNS
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
setIdAttribute
public void setIdAttribute(java.lang.String name, boolean isId) throws org.w3c.dom.DOMException
- Specified by:
setIdAttribute
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
setIdAttributeNode
public void setIdAttributeNode(org.w3c.dom.Attr idAttr, boolean isId) throws org.w3c.dom.DOMException
- Specified by:
setIdAttributeNode
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
setIdAttributeNS
public void setIdAttributeNS(java.lang.String namespaceURI, java.lang.String localName, boolean isId) throws org.w3c.dom.DOMException
- Specified by:
setIdAttributeNS
in interfaceorg.w3c.dom.Element
- Throws:
org.w3c.dom.DOMException
-
getLocalName
public java.lang.String getLocalName()
- Specified by:
getLocalName
in interfaceorg.w3c.dom.Node
- Specified by:
getLocalName
in classNodeImpl
-
getNodeName
public java.lang.String getNodeName()
- Specified by:
getNodeName
in interfaceorg.w3c.dom.Node
- Specified by:
getNodeName
in classNodeImpl
-
getNodeType
public short getNodeType()
- Specified by:
getNodeType
in interfaceorg.w3c.dom.Node
- Specified by:
getNodeType
in classNodeImpl
-
getNodeValue
public java.lang.String getNodeValue() throws org.w3c.dom.DOMException
- Specified by:
getNodeValue
in interfaceorg.w3c.dom.Node
- Specified by:
getNodeValue
in classNodeImpl
- Throws:
org.w3c.dom.DOMException
-
setNodeValue
public void setNodeValue(java.lang.String nodeValue) throws org.w3c.dom.DOMException
- Specified by:
setNodeValue
in interfaceorg.w3c.dom.Node
- Specified by:
setNodeValue
in classNodeImpl
- Throws:
org.w3c.dom.DOMException
-
getRawInnerText
protected java.lang.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
-
-
setInnerText
public void setInnerText(java.lang.String newText)
-
createSimilarNode
protected org.w3c.dom.Node createSimilarNode()
Description copied from class:NodeImpl
Should create a node with some cloned properties, like the node name, but not attributes or children.- Specified by:
createSimilarNode
in classNodeImpl
-
htmlEncodeChildText
protected java.lang.String htmlEncodeChildText(java.lang.String text)
- Overrides:
htmlEncodeChildText
in classNodeImpl
-
-