- All Implemented Interfaces:
CSSElement
,CSSNode
,Serializable
,Cloneable
,Branch
,Element
,Node
,Element
,Node
- Direct Known Subclasses:
XHTMLElement
- See Also:
-
Field Summary
Fields inherited from class org.dom4j.tree.AbstractElement
USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRING
Fields inherited from class org.dom4j.tree.AbstractBranch
DEFAULT_CONTENT_LIST_SIZE
Fields inherited from class org.dom4j.tree.AbstractNode
NODE_TYPE_NAMES
Fields inherited from interface org.dom4j.Node
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE
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
ModifierConstructorDescriptionprotected
CSSStylableElement
(String name) protected
CSSStylableElement
(QName qname) protected
CSSStylableElement
(QName qname, int attributeCount) -
Method Summary
Modifier and TypeMethodDescriptionprotected Attribute
void
Export this element's non-CSS presentational hints (if any) to the suppliedCSSStyleDeclaration
.Gets the computed style declaration that applies to this element.getComputedStyle
(String pseudoElt) Gets the computed style declaration that applies to this element.protected XHTMLDocumentFactory
getFeature
(String feature, String version) Deprecated.abstract String
getId()
Gets theid
attribute of this element.getOverrideStyle
(Condition pseudoElt) Gets this element's override style declaration for a pseudo-element.TheXHTMLDocument
object which is the root ancestor of this node.Gets the selector matcher for this element.getStyle()
Gets the inline style declaration from the current contents of thestyle
XHTML attribute.boolean
hasOverrideStyle
(Condition pseudoElt) Check whether this element has an override style declaration for the given pseudo-element.boolean
Check whether this element has non-CSS presentational hints.boolean
matches
(SelectorList selist, Condition pseudoElement) Does this element (with the provided pseudo-element, if any) match the provided selector list ?boolean
Does this element (with the provided pseudo-element, if any) match the provided selector string ?setAttributeNode
(Attr newAttr) setAttributeNodeNS
(Attr newAttr) void
setIdAttribute
(String name, boolean isId) Deprecated.void
setIdAttributeNode
(Attr idAttr, boolean isId) Deprecated.void
setIdAttributeNS
(String namespaceURI, String localName, boolean isId) Deprecated.Methods inherited from class org.dom4j.dom.DOMElement
appendChild, attribute, cloneNode, compareDocumentPosition, createAttribute, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getChildNodes, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getQName, getSchemaTypeInfo, getTagName, getTextContent, getUserData, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, setAttribute, setAttributeNS, setNodeValue, setPrefix, setTextContent, setUserData, supports
Methods inherited from class org.dom4j.tree.DefaultElement
add, additionalNamespaces, additionalNamespaces, addNewNode, attribute, attribute, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, attributes, clearContent, clone, contentList, declaredNamespaces, element, element, element, getNamespaceForPrefix, getNamespaceForURI, getParent, getQName, getStringValue, getText, indexOf, node, nodeCount, nodeIterator, processingInstruction, processingInstructions, processingInstructions, remove, removeNode, removeProcessingInstruction, setAttributeList, setAttributes, setContent, setDocument, setParent, setQName, supportsParent
Methods inherited from class org.dom4j.tree.AbstractElement
accept, add, add, add, add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addElement, addEntity, addNamespace, addNewNode, addNode, addNode, addProcessingInstruction, addProcessingInstruction, addText, appendAttributes, asXML, attributeValue, attributeValue, attributeValue, attributeValue, childAdded, childRemoved, createAttributeList, createAttributeList, createCopy, createCopy, createCopy, createElement, createElement, createSingleIterator, elementIterator, elementIterator, elementIterator, elementIterator, elements, elements, elements, elements, elementText, elementText, elementTextTrim, elementTextTrim, ensureAttributesCapacity, getData, getName, getNamespace, getNamespacePrefix, getNamespacesForURI, getNodeType, getPath, getQName, getQualifiedName, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setData, setName, setNamespace, setText, toString, write
Methods inherited from class org.dom4j.tree.AbstractBranch
addElement, addElement, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getTextTrim, hasContent, invalidNodeTypeAddException, isReadOnly, setProcessingInstructions
Methods inherited from class org.dom4j.tree.AbstractNode
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.dom4j.Branch
addElement, addElement, appendContent, content, elementByID, setProcessingInstructions
Methods inherited from interface org.dom4j.Element
getTextTrim
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNS
Methods inherited from interface org.dom4j.Node
asXPathResult, createXPath, detach, getNodeTypeName, getPath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Constructor Details
-
CSSStylableElement
-
CSSStylableElement
-
CSSStylableElement
-
-
Method Details
-
getOwnerDocument
TheXHTMLDocument
object which is the root ancestor of this node.This is also the
XHTMLDocument
object used to create new nodes.- Specified by:
getOwnerDocument
in interfaceCSSNode
- Specified by:
getOwnerDocument
in interfaceNode
- Overrides:
getOwnerDocument
in classDOMElement
- Returns:
- the
XHTMLDocument
object which is the root ancestor of this node, ornull
if this node is anXHTMLDocument
, aDocumentType
which is not used inside anyXHTMLDocument
yet, or this node is not part of a document.
-
getDocument
- Specified by:
getDocument
in interfaceNode
- Overrides:
getDocument
in classDefaultElement
-
getDocumentFactory
- Overrides:
getDocumentFactory
in classDOMElement
-
setAttributeNode
- Specified by:
setAttributeNode
in interfaceElement
- Overrides:
setAttributeNode
in classDOMElement
- Throws:
DOMException
-
setAttributeNodeNS
- Specified by:
setAttributeNodeNS
in interfaceElement
- Overrides:
setAttributeNodeNS
in classDOMElement
- Throws:
DOMException
-
attribute
- Overrides:
attribute
in classDOMElement
-
getBaseURI
- Specified by:
getBaseURI
in interfaceNode
- Overrides:
getBaseURI
in classDOMElement
-
getFeature
Deprecated.- Specified by:
getFeature
in interfaceNode
- Overrides:
getFeature
in classDOMElement
-
setIdAttribute
Deprecated.- Specified by:
setIdAttribute
in interfaceElement
- Overrides:
setIdAttribute
in classDOMElement
- Throws:
DOMException
-
setIdAttributeNS
@Deprecated public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException Deprecated.- Specified by:
setIdAttributeNS
in interfaceElement
- Overrides:
setIdAttributeNS
in classDOMElement
- Throws:
DOMException
-
setIdAttributeNode
Deprecated.- Specified by:
setIdAttributeNode
in interfaceElement
- Overrides:
setIdAttributeNode
in classDOMElement
-
getId
Gets theid
attribute of this element.- Specified by:
getId
in interfaceCSSElement
- Returns:
- the
id
attribute, or the empty string if has no ID.
-
getStyle
Gets the inline style declaration from the current contents of thestyle
XHTML attribute.- Specified by:
getStyle
in interfaceCSSElement
- Returns:
- the style declaration, or
null
if the element has nostyle
attribute.
-
hasPresentationalHints
public boolean hasPresentationalHints()Description copied from interface:CSSElement
Check whether this element has non-CSS presentational hints.A document may contain non-CSS presentational hints (like the
width
attribute in HTML). This method can returntrue
only if this specific element do contain such hints, which can be exported to a style declaration by using theCSSElement.exportHintsToStyle(CSSStyleDeclaration)
method.- Specified by:
hasPresentationalHints
in interfaceCSSElement
- Returns:
true
if this element has presentational hints.
-
exportHintsToStyle
Description copied from interface:CSSElement
Export this element's non-CSS presentational hints (if any) to the suppliedCSSStyleDeclaration
.- Specified by:
exportHintsToStyle
in interfaceCSSElement
- Parameters:
style
- the style declaration to export to.
-
hasOverrideStyle
Description copied from interface:CSSElement
Check whether this element has an override style declaration for the given pseudo-element.This method allows checking for override styles without the overhead of producing and retrieving one with
CSSElement.getOverrideStyle(Condition)
and checking its length.- Specified by:
hasOverrideStyle
in interfaceCSSElement
- Parameters:
pseudoElt
- the pseudo-element condition, ornull
if none.- Returns:
true
if this element has an override style declaration forpseudoElt
.
-
getOverrideStyle
Description copied from interface:CSSElement
Gets this element's override style declaration for a pseudo-element.The getOverrideStyle method provides a mechanism through which a DOM author could effect immediate change to the style of an element without modifying the explicitly linked style sheets of a document or the inline style of elements.
The override style sheet comes after the author style sheet in the cascade algorithm.
- Specified by:
getOverrideStyle
in interfaceCSSElement
- Parameters:
pseudoElt
- the pseudo-element condition, ornull
if none.- Returns:
- the override style sheet for the given pseudo-element.
-
getComputedStyle
Gets the computed style declaration that applies to this element.- Specified by:
getComputedStyle
in interfaceCSSElement
- Parameters:
pseudoElt
- the pseudo-element name.- Returns:
- the computed style declaration.
-
getComputedStyle
Gets the computed style declaration that applies to this element.- Returns:
- the computed style declaration, or null if none applies.
-
getSelectorMatcher
Gets the selector matcher for this element.- Specified by:
getSelectorMatcher
in interfaceCSSElement
- Returns:
- the selector matcher.
-
matches
Description copied from interface:CSSElement
Does this element (with the provided pseudo-element, if any) match the provided selector string ?- Specified by:
matches
in interfaceCSSElement
- Parameters:
selectorString
- the selector string.pseudoElement
- the pseudo-element, or null if none.- Returns:
true
if the element would be selected by the specified selector string, false otherwise.- Throws:
DOMException
- SYNTAX_ERR if there was an error parsing the selector string.
-
matches
Description copied from interface:CSSElement
Does this element (with the provided pseudo-element, if any) match the provided selector list ?- Specified by:
matches
in interfaceCSSElement
- Parameters:
selist
- the selector list.pseudoElement
- the pseudo-element condition, ornull
if none.- Returns:
true
if the element would be selected by at least one selector in the specified list,false
otherwise.
-