public class HTMLElementImp extends org.apache.xerces.dom.ElementImpl implements HTMLElement
firstChild, fNodeListCache, ownerDocumentDOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODEATTRIBUTE_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_NODEDERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION| Modifier | Constructor and Description |
|---|---|
protected |
HTMLElementImp(HTMLDocumentImp owner,
String tag)
Make a new HTML element.
|
| Modifier and Type | Method and Description |
|---|---|
Node |
appendChild(Node newChild)
First adopts the new child, then appends it.
|
void |
blur()
Does nothing.
|
protected String |
capitalize(String value)
Convenience method used to capitalise a one-off attribute value before it
is returned.
|
void |
click()
Does nothing.
|
HTMLElement |
cloneNode(boolean deep) |
protected <T extends HTMLElement> |
createElement(Class<T> c)
Factory method for convenience:
Creates an element of this interface.
|
protected HTMLElement |
createElement(String tag)
Factory method for convenience
|
void |
deleter(String key)
Deletes the element at this key.
|
void |
focus()
Does nothing.
|
String |
get(String key)
If there is an element at this key, return it.
|
String |
getAccessKey() |
String |
getAccessKeyLabel()
On the server, we don't assign access keys.
|
protected double |
getAttribute(String key,
double def) |
protected int |
getAttribute(String key,
int def)
Tries to read an attribute as int, else returns default value.
|
protected String |
getAttribute(String key,
String def)
Tries to read an attribute as String, else returns default value.
|
protected boolean |
getAttributeBoolean(String key)
Boolean attributes in HTML:
If the attribute has any value, it is considered true.
|
protected double |
getAttributeDouble(String key)
Returns 0.0 if the attribute cannot be parsed as double.
|
protected int |
getAttributeInt(String key)
Returns 0 if the attribute cannot be parsed as int.
|
protected long |
getAttributeLong(String key)
Returns 0 if the attribute cannot be parsed as long.
|
Attr |
getAttributeNodeNS(String namespace,
String key) |
String |
getAttributeNS(String namespace,
String key) |
HTMLCollection<HTMLElement> |
getChildElements()
Convenience: get all children that are elements.
|
NodeList |
getChildNodes()
Explicit implementation of getChildNodes() to avoid problems with
overriding the getLength() method hidden in the super class.
|
String |
getClassName() |
String |
getContentEditable()
Not implemented.
|
DOMStringMap |
getDataset()
|
String |
getDir() |
protected HTMLElement |
getElementById(String id)
Convenience for subclass implementations
|
protected HTMLElement |
getElementByTagName(String tag)
Convenience: returns the first child element with this tag, or null.
|
HTMLCollection<HTMLElement> |
getElementsByTagName(String tag) |
NodeList |
getElementsByTagNameNS(String namespace,
String tag) |
protected HTMLFormElement |
getForm()
Convenience method returns the form in which this form element is contained.
|
boolean |
getHidden() |
String |
getId() |
String |
getLang() |
String |
getName() |
HTMLDocument |
getOwnerDocument() |
boolean |
getSpellcheck()
Not implemented.
|
String |
getStyle() |
int |
getTabIndex() |
String |
getTagName()
Always lowercase
|
protected String |
getText()
Convenience: concatenates the text of all Text children of this element,
ignoring comment and data.
|
String |
getTitle() |
boolean |
getTranslate()
Not implemented.
|
boolean |
has(String key) |
Node |
insertBefore(Node newChild,
Node refChild)
First adopts the new child, then inserts it.
|
boolean |
isContentEditable()
Not implemented.
|
protected boolean |
isInDocument()
Is this element inside a document?
The only document that it can be in is its owner document.
|
void |
prepend(HTMLElement element)
Add an element as first child.
|
protected void |
remove()
Removes the element from its parent.
|
void |
set(String key,
int value) |
void |
set(String key,
String value)
Set the element at this key.
|
void |
setAccessKey(String key) |
protected void |
setAttribute(String key,
boolean b)
Boolean attributes in HTML:
True: set the attribute using the key also as value.
|
protected void |
setAttribute(String key,
double d)
Sets attribute to a number, formatting the number without trailing zeros.
|
protected void |
setAttribute(String key,
int i) |
protected void |
setAttribute(String key,
long i) |
void |
setClassName(String className) |
void |
setContentEditable(String s)
Not implemented.
|
void |
setDir(String dir) |
void |
setHidden(boolean h) |
void |
setId(String id) |
void |
setLang(String lang) |
void |
setName(String n) |
void |
setSpellcheck(boolean b)
Not implemented.
|
void |
setStyle(String style) |
void |
setTabIndex(int t) |
void |
setTitle(String title) |
void |
setTranslate(boolean t) |
String |
toString()
Formats the whole element.
|
protected String |
yesNo(boolean b)
Converts true to "yes" and false to "no".
|
getAttribute, getAttributeNode, getAttributes, getBaseURI, getChildElementCount, getDefaultAttributes, getFirstElementChild, getLastElementChild, getNextElementSibling, getNodeName, getNodeType, getPreviousElementSibling, getSchemaTypeInfo, getTypeName, getTypeNamespace, getXercesAttribute, getXMLBaseAttribute, hasAttribute, hasAttributeNS, hasAttributes, isDerivedFrom, isEqualNode, normalize, reconcileDefaultAttributes, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setOwnerDocument, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeDatagetChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getTextContent, hasChildNodes, item, removeChild, replaceChild, setTextContent, synchronizeChildrengetNextSibling, getParentNode, getPreviousSiblingaddEventListener, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getLocalName, getNamespaceURI, getNodeNumber, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, getUserDataRecord, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setPrefix, setUserData, setUserDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAttribute, getAttributeNode, getSchemaTypeInfo, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNScompareDocumentPosition, getAttributes, getBaseURI, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserDataprotected HTMLElementImp(HTMLDocumentImp owner, String tag)
owner - The documenttag - The tag name. Not case-sensitive. Will be converted to lower-case.public HTMLElement cloneNode(boolean deep)
public Node insertBefore(Node newChild, Node refChild) throws DOMException
insertBefore in interface NodeinsertBefore in class org.apache.xerces.dom.ParentNodenewChild - the new childrefChild - If null, inserts at end.DOMExceptionNodeImpl.appendChild(org.w3c.dom.Node)public Node appendChild(Node newChild) throws DOMException
appendChild in interface NodeappendChild in class org.apache.xerces.dom.NodeImplnewChild - the new childDOMExceptionNodeImpl.appendChild(org.w3c.dom.Node)public NodeList getChildNodes()
getChildNodes in interface NodegetChildNodes in class org.apache.xerces.dom.ParentNodepublic HTMLCollection<HTMLElement> getChildElements()
HTMLElementprotected void remove()
protected HTMLElement getElementById(String id)
id - of the element to getpublic String getStyle()
public void setStyle(String style)
protected HTMLFormElement getForm()
protected String getText()
public void prepend(HTMLElement element)
element - the elementpublic String getId()
getId in interface org.w3c.dom.html.HTMLElementpublic void setId(String id)
setId in interface org.w3c.dom.html.HTMLElementpublic String getName()
public void setName(String n)
public String getTitle()
getTitle in interface org.w3c.dom.html.HTMLElementpublic void setTitle(String title)
setTitle in interface org.w3c.dom.html.HTMLElementpublic String getLang()
getLang in interface org.w3c.dom.html.HTMLElementpublic void setLang(String lang)
setLang in interface org.w3c.dom.html.HTMLElementpublic HTMLDocument getOwnerDocument()
getOwnerDocument in interface NodegetOwnerDocument in class org.apache.xerces.dom.ParentNodeprotected boolean isInDocument()
public String getDir()
getDir in interface org.w3c.dom.html.HTMLElementpublic void setDir(String dir)
setDir in interface org.w3c.dom.html.HTMLElementpublic String getClassName()
getClassName in interface org.w3c.dom.html.HTMLElementpublic void setClassName(String className)
setClassName in interface org.w3c.dom.html.HTMLElementpublic boolean getTranslate()
public void setTranslate(boolean t)
public DOMStringMap getDataset()
public boolean getHidden()
public void setHidden(boolean h)
public int getTabIndex()
public void setTabIndex(int t)
public String getAccessKey()
public void setAccessKey(String key)
public String getAccessKeyLabel()
public String getContentEditable()
public void setContentEditable(String s)
public boolean isContentEditable()
public boolean getSpellcheck()
public void setSpellcheck(boolean b)
public void blur()
public void focus()
public void click()
public Attr getAttributeNodeNS(String namespace, String key)
getAttributeNodeNS in interface ElementgetAttributeNodeNS in class org.apache.xerces.dom.ElementImplnamespace - the namespacekey - case-sensitiveprotected String getAttribute(String key, String def)
key - the keydef - The default value.public String getAttributeNS(String namespace, String key)
getAttributeNS in interface ElementgetAttributeNS in class org.apache.xerces.dom.ElementImplnamespace - the namespacekey - case-sensitivepublic HTMLCollection<HTMLElement> getElementsByTagName(String tag)
getElementsByTagName in interface ElementgetElementsByTagName in class org.apache.xerces.dom.ElementImpltag - Will be made lower-casepublic NodeList getElementsByTagNameNS(String namespace, String tag)
getElementsByTagNameNS in interface ElementgetElementsByTagNameNS in class org.apache.xerces.dom.ElementImpltag - Will be made lower-casepublic String getTagName()
getTagName in interface ElementgetTagName in class org.apache.xerces.dom.ElementImplprotected String capitalize(String value)
value - The value of the attributeprotected String yesNo(boolean b)
b - the booleanprotected boolean getAttributeBoolean(String key)
key - the keyprotected void setAttribute(String key, boolean b)
key - the keyb - true or falseprotected int getAttributeInt(String key)
key - the keyprotected int getAttribute(String key, int def)
key - the keydef - The default value, often 0 or 1.protected void setAttribute(String key, int i)
protected double getAttributeDouble(String key)
key - the keyprotected double getAttribute(String key, double def)
protected void setAttribute(String key, double d)
key - the keyd - the doubleprotected long getAttributeLong(String key)
key - the keyprotected void setAttribute(String key, long i)
public String toString()
toString in class org.apache.xerces.dom.NodeImplprotected HTMLElement createElement(String tag)
tag - make an element with this tagprotected <T extends HTMLElement> T createElement(Class<T> c)
T - type of the new elementc - Interface like HTMLTableCaptionElementNotImplementedException - Not implemented for this interface,
maybe because the interface applies to several tag names
and therefore the call is ambiguous.protected HTMLElement getElementByTagName(String tag)
tag - looking for elements with this tagpublic boolean has(String key)
public String get(String key)
ScriptMappublic void set(String key, String value)
ScriptMapCopyright © 2017. All rights reserved.