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.Mapattributes-
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 voidassignAttributeField(java.lang.String normalName, java.lang.String value)protected org.w3c.dom.NodecreateSimilarNode()Should create a node with some cloned properties, like the node name, but not attributes or children.booleanequalAttributes(org.w3c.dom.Node arg)java.lang.StringgetAttribute(java.lang.String name)org.w3c.dom.AttrgetAttributeNode(java.lang.String name)org.w3c.dom.AttrgetAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)java.lang.StringgetAttributeNS(java.lang.String namespaceURI, java.lang.String localName)org.w3c.dom.NamedNodeMapgetAttributes()java.lang.StringgetDir()org.w3c.dom.NodeListgetElementsByTagName(java.lang.String name)org.w3c.dom.NodeListgetElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)java.lang.StringgetId()java.lang.StringgetLang()java.lang.StringgetLocalName()java.lang.StringgetNodeName()shortgetNodeType()java.lang.StringgetNodeValue()protected java.lang.StringgetRawInnerText(boolean includeComment)Gets inner text of the element, possibly including text in comments.org.w3c.dom.TypeInfogetSchemaTypeInfo()java.lang.StringgetTagName()java.lang.StringgetTitle()booleanhasAttribute(java.lang.String name)booleanhasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)booleanhasAttributes()protected java.lang.StringhtmlEncodeChildText(java.lang.String text)protected static booleanisTagName(org.w3c.dom.Node node, java.lang.String name)protected java.lang.StringnormalizeAttributeName(java.lang.String name)voidremoveAttribute(java.lang.String name)org.w3c.dom.AttrremoveAttributeNode(org.w3c.dom.Attr oldAttr)voidremoveAttributeNS(java.lang.String namespaceURI, java.lang.String localName)voidsetAttribute(java.lang.String name, java.lang.String value)voidsetAttributeImpl(java.lang.String name, java.lang.String value)Fast method to set attributes.org.w3c.dom.AttrsetAttributeNode(org.w3c.dom.Attr newAttr)org.w3c.dom.AttrsetAttributeNodeNS(org.w3c.dom.Attr newAttr)voidsetAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value)voidsetDir(java.lang.String dir)voidsetId(java.lang.String id)voidsetIdAttribute(java.lang.String name, boolean isId)voidsetIdAttributeNode(org.w3c.dom.Attr idAttr, boolean isId)voidsetIdAttributeNS(java.lang.String namespaceURI, java.lang.String localName, boolean isId)voidsetInnerText(java.lang.String newText)voidsetLang(java.lang.String lang)voidsetNodeValue(java.lang.String nodeValue)voidsetTitle(java.lang.String title)java.lang.StringtoString()-
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:
getAttributesin interfaceorg.w3c.dom.Node- Overrides:
getAttributesin classNodeImpl
-
hasAttributes
public boolean hasAttributes()
- Specified by:
hasAttributesin interfaceorg.w3c.dom.Node- Overrides:
hasAttributesin classNodeImpl
-
equalAttributes
public boolean equalAttributes(org.w3c.dom.Node arg)
- Overrides:
equalAttributesin 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:
getAttributein interfaceorg.w3c.dom.Element
-
getAttributeNode
public org.w3c.dom.Attr getAttributeNode(java.lang.String name)
- Specified by:
getAttributeNodein 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:
getAttributeNodeNSin 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:
getAttributeNSin 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:
getElementsByTagNamein 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:
getElementsByTagNameNSin interfaceorg.w3c.dom.Element- Throws:
org.w3c.dom.DOMException
-
getSchemaTypeInfo
public org.w3c.dom.TypeInfo getSchemaTypeInfo()
- Specified by:
getSchemaTypeInfoin interfaceorg.w3c.dom.Element
-
getTagName
public java.lang.String getTagName()
- Specified by:
getTagNamein interfaceorg.w3c.dom.Element
-
hasAttribute
public boolean hasAttribute(java.lang.String name)
- Specified by:
hasAttributein interfaceorg.w3c.dom.Element
-
hasAttributeNS
public boolean hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName) throws org.w3c.dom.DOMException- Specified by:
hasAttributeNSin interfaceorg.w3c.dom.Element- Throws:
org.w3c.dom.DOMException
-
removeAttribute
public void removeAttribute(java.lang.String name) throws org.w3c.dom.DOMException- Specified by:
removeAttributein 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:
removeAttributeNodein 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:
removeAttributeNSin 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:
setAttributein 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.DOMExceptionFast 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:
setAttributeNodein 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:
setAttributeNodeNSin 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:
setAttributeNSin 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:
setIdAttributein 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:
setIdAttributeNodein 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:
setIdAttributeNSin interfaceorg.w3c.dom.Element- Throws:
org.w3c.dom.DOMException
-
getLocalName
public java.lang.String getLocalName()
- Specified by:
getLocalNamein interfaceorg.w3c.dom.Node- Specified by:
getLocalNamein classNodeImpl
-
getNodeName
public java.lang.String getNodeName()
- Specified by:
getNodeNamein interfaceorg.w3c.dom.Node- Specified by:
getNodeNamein classNodeImpl
-
getNodeType
public short getNodeType()
- Specified by:
getNodeTypein interfaceorg.w3c.dom.Node- Specified by:
getNodeTypein classNodeImpl
-
getNodeValue
public java.lang.String getNodeValue() throws org.w3c.dom.DOMException- Specified by:
getNodeValuein interfaceorg.w3c.dom.Node- Specified by:
getNodeValuein classNodeImpl- Throws:
org.w3c.dom.DOMException
-
setNodeValue
public void setNodeValue(java.lang.String nodeValue) throws org.w3c.dom.DOMException- Specified by:
setNodeValuein interfaceorg.w3c.dom.Node- Specified by:
setNodeValuein 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:NodeImplShould create a node with some cloned properties, like the node name, but not attributes or children.- Specified by:
createSimilarNodein classNodeImpl
-
htmlEncodeChildText
protected java.lang.String htmlEncodeChildText(java.lang.String text)
- Overrides:
htmlEncodeChildTextin classNodeImpl
-
-