|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.htmlunit.corejs.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.host.Node
com.gargoylesoftware.htmlunit.javascript.host.EventNode
com.gargoylesoftware.htmlunit.javascript.host.Element
public class Element
A JavaScript object for DomElement
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary |
---|
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.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 |
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
Element()
|
Method Summary | |
---|---|
protected NamedNodeMap |
createAttributesObject()
Creates the JS object for the property attributes. |
protected String |
fixAttributeName(String attributeName)
Allows subclasses to transform the attribute name before it gets used. |
DomElement |
getDomNodeOrDie()
Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found. |
Object |
jsxFunction_getAttribute(String attributeName,
Integer flags)
Returns the value of the specified attribute. |
Object |
jsxFunction_getAttributeNode(String name)
Retrieves an attribute node by name. |
Object |
jsxFunction_getElementsByTagName(String tagName)
Returns all the descendant elements with the specified tag name. |
Object |
jsxFunction_getElementsByTagNameNS(Object namespaceURI,
String localName)
Returns a list of elements with the given tag name belonging to the given namespace. |
boolean |
jsxFunction_hasAttribute(String name)
Returns true when an attribute with a given name is specified on this element or has a default value. |
void |
jsxFunction_removeAttribute(String name)
Removes the specified attribute. |
HTMLCollection |
jsxFunction_selectNodes(String expression)
Applies the specified XPath expression to this node's context and returns the generated list of matching nodes. |
Object |
jsxFunction_selectSingleNode(String expression)
Applies the specified pattern-matching operation to this node's context and returns the first matching node. |
void |
jsxFunction_setAttribute(String name,
String value)
Sets an attribute. |
Object |
jsxGet_attributes()
Returns the attributes of this XML element. |
String |
jsxGet_tagName()
Returns the tag name of this element. |
String |
jsxGet_text()
Represents the text content of the node or the concatenated text representing the node and its descendants. |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
---|
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setHtmlElement |
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public Element()
Method Detail |
---|
public HTMLCollection jsxFunction_selectNodes(String expression)
expression
- a string specifying an XPath expression
public Object jsxFunction_selectSingleNode(String expression)
expression
- a string specifying an XPath expression
public final String jsxGet_tagName()
public Object jsxGet_attributes()
protected NamedNodeMap createAttributesObject()
public Object jsxFunction_getAttribute(String attributeName, Integer flags)
attributeName
- attribute nameflags
- IE-specific flags (see the MSDN documentation for more info)
null
if the attribute is not definedprotected String fixAttributeName(String attributeName)
attributeName
- the original attribute
public void jsxFunction_setAttribute(String name, String value)
name
- Name of the attribute to setvalue
- Value to set the attribute topublic Object jsxFunction_getElementsByTagName(String tagName)
tagName
- the name to search for
public Object jsxFunction_getAttributeNode(String name)
name
- the name of the attribute to retrieve
null
if there is no such attributepublic String jsxGet_text()
public Object jsxFunction_getElementsByTagNameNS(Object namespaceURI, String localName)
namespaceURI
- the namespace URI of elements to look forlocalName
- is either the local name of elements to look for or the special value "*",
which matches all elements.
public boolean jsxFunction_hasAttribute(String name)
name
- the name of the attribute to look for
public DomElement getDomNodeOrDie()
getDomNodeOrDie
in class SimpleScriptable
public void jsxFunction_removeAttribute(String name)
name
- the name of the attribute to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |