|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.HTMLCollection
public class HTMLCollection
An array of elements. Used for the element arrays returned by document.all,
document.all.tags('x'), document.forms, window.frames, etc.
Note that this class must not be used for collections that can be modified, for example
map.areas and select.options.
This class (like all classes in this package) is specific for the javascript engine.
Users of HtmlUnit shouldn't use it directly.
Field Summary |
---|
Fields inherited from class org.mozilla.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface org.mozilla.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
HTMLCollection()
Create an instance. |
|
HTMLCollection(SimpleScriptable parentScope)
Create an instance |
Method Summary | |
---|---|
java.lang.Object |
call(org.mozilla.javascript.Context context,
org.mozilla.javascript.Scriptable scope,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] args)
|
org.mozilla.javascript.Scriptable |
construct(org.mozilla.javascript.Context arg0,
org.mozilla.javascript.Scriptable arg1,
java.lang.Object[] arg2)
|
java.lang.Object |
get(int index,
org.mozilla.javascript.Scriptable start)
Returns the element at the specified index, or NOT_FOUND if the index is invalid. |
void |
init(DomNode node,
org.jaxen.XPath xpath)
Init the content of this collection. |
void |
init(DomNode node,
org.jaxen.XPath xpath,
org.apache.commons.collections.Transformer transformer)
Init the content of this collection. |
java.lang.Object |
jsxFunction_item(java.lang.Object index)
Retrieves the item or items corresponding to the specified index or key. |
java.lang.Object |
jsxFunction_namedItem(java.lang.String name)
Retrieves the item or items corresponding to the specified name (checks ids, and if that does not work, then names). |
java.lang.Object |
jsxFunction_tags(java.lang.String tagName)
Returns all the elements in this element array that have the specified tag name. |
int |
jsxGet_length()
Returns the length of this element array. |
java.lang.String |
toString()
Just for debug purpose. |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
---|
get, getBooleanArg, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getHtmlElementOrDie, getHtmlElementOrNull, getIntArg, getObjectArg, getStringArg, makeScriptableFor, setDomNode, setHtmlElement |
Methods inherited from class org.mozilla.javascript.ScriptableObject |
---|
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mozilla.javascript.Scriptable |
---|
delete, delete, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, put, put, setParentScope, setPrototype |
Constructor Detail |
---|
public HTMLCollection()
public HTMLCollection(SimpleScriptable parentScope)
parentScope
- parent scopeMethod Detail |
---|
public final java.lang.Object call(org.mozilla.javascript.Context context, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args) throws org.mozilla.javascript.JavaScriptException
call
in interface org.mozilla.javascript.Callable
call
in interface org.mozilla.javascript.Function
org.mozilla.javascript.JavaScriptException
public final org.mozilla.javascript.Scriptable construct(org.mozilla.javascript.Context arg0, org.mozilla.javascript.Scriptable arg1, java.lang.Object[] arg2) throws org.mozilla.javascript.JavaScriptException
construct
in interface org.mozilla.javascript.Function
org.mozilla.javascript.JavaScriptException
public final java.lang.Object get(int index, org.mozilla.javascript.Scriptable start)
get
in interface org.mozilla.javascript.Scriptable
get
in class org.mozilla.javascript.ScriptableObject
public void init(DomNode node, org.jaxen.XPath xpath)
node
- the node to serve as root for the xpath expressionxpath
- the xpath giving the elements of the collectionpublic void init(DomNode node, org.jaxen.XPath xpath, org.apache.commons.collections.Transformer transformer)
node
- the node to serve as root for the xpath expressionxpath
- the xpath giving the elements of the collectiontransformer
- the transformer allowing to get the expected objects from the xpath
evaluationpublic final java.lang.Object jsxFunction_item(java.lang.Object index)
index
- The index or key corresponding to the element or elements to return.
public final java.lang.Object jsxFunction_namedItem(java.lang.String name)
name
- The name or id the element or elements to return.
public final java.lang.Object jsxFunction_tags(java.lang.String tagName)
tagName
- The name of the tag of the elements to return.
public final int jsxGet_length()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |