public class HTMLElementImpl extends ElementImpl implements org.w3c.dom.html.HTMLElement
Element
that
will only appear inside HTML documents. This element extends ElementImpl
by adding methods for directly manipulating
HTML-specific attributes. All HTML elements gain access to the
id
, title
, lang
, dir
and class
attributes. Other elements add their own specific
attributes.
Note that some support is provided by NodeImpl
directly: translating all tag names to upper case and all attribute names
to lower case.
HTMLElement
,
ElementImpl
ATTLIST_DECL_NODE, ELEMENT_DECL_NODE, PARAM_ENTITY_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
Modifier and Type | Method and Description |
---|---|
protected NodeImpl |
castNewChild(Node newChild)
Checks whether newChild can be added to this node as a child,
and if so, performs a necessary cast.
|
Object |
clone() |
Node |
cloneNode(boolean deep) |
String |
getAttribute(String attrName) |
Attr |
getAttributeNode(String attrName) |
Attr |
getAttributeNodeNS(String namespaceURI,
String localName) |
String |
getAttributeNS(String namespaceURI,
String localName) |
String |
getClassName() |
String |
getDir() |
NodeList |
getElementsByTagName(String tagName)
Returns a list of elements extracted based on their tag name (or all of
them if the tag name is "*").
|
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName) |
org.w3c.dom.html.HTMLFormElement |
getForm()
Convenience method returns the form in which this form element is contained.
|
String |
getId() |
String |
getLang() |
String |
getTitle() |
void |
setClassName(String className) |
void |
setDir(String dir) |
void |
setId(String id) |
void |
setLang(String lang) |
void |
setTitle(String title) |
cloneInto, compareDocumentPosition, equals, getAttributes, getBaseURI, getFeature, getNodeType, getSchemaTypeInfo, getTagName, getTextContent, getUserData, hasAttribute, hasAttributeNS, hasAttributes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setTextContent, setUserData, toString
getLocalName, getNamespaceURI, getPrefix, setPrefix
appendChild, castOldChild, createNodeIterator, getChildNodes, getFirstChild, getLastChild, hasChildNodes, insertBefore, removeChild, removeInnerIterator, replaceChild
getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, isReadOnly, makeReadOnly, setOwnerDocument, supports
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
public String getId()
getId
in interface org.w3c.dom.html.HTMLElement
public void setId(String id)
setId
in interface org.w3c.dom.html.HTMLElement
public String getTitle()
getTitle
in interface org.w3c.dom.html.HTMLElement
public void setTitle(String title)
setTitle
in interface org.w3c.dom.html.HTMLElement
public String getLang()
getLang
in interface org.w3c.dom.html.HTMLElement
public void setLang(String lang)
setLang
in interface org.w3c.dom.html.HTMLElement
public String getDir()
getDir
in interface org.w3c.dom.html.HTMLElement
public void setDir(String dir)
setDir
in interface org.w3c.dom.html.HTMLElement
public String getClassName()
getClassName
in interface org.w3c.dom.html.HTMLElement
public void setClassName(String className)
setClassName
in interface org.w3c.dom.html.HTMLElement
public Attr getAttributeNode(String attrName)
getAttributeNode
in interface Element
getAttributeNode
in class ElementImpl
public Attr getAttributeNodeNS(String namespaceURI, String localName)
getAttributeNodeNS
in interface Element
getAttributeNodeNS
in class ElementImpl
public String getAttribute(String attrName)
getAttribute
in interface Element
getAttribute
in class ElementImpl
public String getAttributeNS(String namespaceURI, String localName)
getAttributeNS
in interface Element
getAttributeNS
in class ElementImpl
public final NodeList getElementsByTagName(String tagName)
ElementImpl
getElementsByTagName
in interface Element
getElementsByTagName
in class ElementImpl
tagName
- The element tag name to look for or "*" for all elementspublic final NodeList getElementsByTagNameNS(String namespaceURI, String localName)
getElementsByTagNameNS
in interface Element
getElementsByTagNameNS
in class ElementImpl
public org.w3c.dom.html.HTMLFormElement getForm()
protected NodeImpl castNewChild(Node newChild) throws DOMException
ParentNodeImpl
The following rules govern the allowed newChild types:
Attr
, newChild must be
either a Text
or an EntityReference
DocumentType
, newChild must be
either an Entity
or a Notation
.
Element
, a CharacterData
derived type, a DocumentFragment
, an EntityReference
or a ProcessingInstruction
.
castNewChild
in class ParentNodeImpl
newChild
- New child nodeNodeImpl
DOMException
- HIERARCHY_REQUEST_ERR
newChild is null, does not belong to this DOM, or its node
type is not supported for this parentpublic final Object clone()
clone
in class ElementImpl
public final Node cloneNode(boolean deep)
cloneNode
in interface Node
cloneNode
in class ElementImpl
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.