public class HTMLCollection extends SimpleScriptable implements org.mozilla.javascript.Function
| Constructor and Description |
|---|
HTMLCollection()
Create an instance.
|
HTMLCollection(SimpleScriptable parentScope)
Create an instance
|
| Modifier and Type | Method and Description |
|---|---|
Object |
call(org.mozilla.javascript.Context context,
org.mozilla.javascript.Scriptable scope,
org.mozilla.javascript.Scriptable thisObj,
Object[] args) |
org.mozilla.javascript.Scriptable |
construct(org.mozilla.javascript.Context arg0,
org.mozilla.javascript.Scriptable arg1,
Object[] arg2) |
protected Object |
equivalentValues(Object other)
Called for the js "==".
|
Object |
get(int index,
org.mozilla.javascript.Scriptable start)
Returns the element at the specified index, or NOT_FOUND if the
index is invalid.
|
Object[] |
getIds()
Returns the element or elements that match the specified key.
|
protected Object |
getWithPreemption(String name)
Returns the element or elements that match the specified key.
|
boolean |
has(String name,
org.mozilla.javascript.Scriptable start) |
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.
|
Object |
jsxFunction_item(Object index)
Retrieves the item or items corresponding to the specified index or key.
|
Object |
jsxFunction_namedItem(String name)
Retrieves the item or items corresponding to the specified name (checks ids, and if
that does not work, then names).
|
Object |
jsxFunction_tags(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.
|
String |
toString()
Just for debug purpose.
|
get, getBooleanArg, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getIntArg, getLog, getObjectArg, getPrototype, getScriptableFor, getStartingScope, getStringArg, getTransformerScriptableFor, getWindow, getWindow, makeScriptableFor, setDomNode, setDomNode, setHtmlElementassociateValue, 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, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototypepublic HTMLCollection()
public HTMLCollection(SimpleScriptable parentScope)
parentScope - parent scopepublic 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 Object call(org.mozilla.javascript.Context context, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, Object[] args) throws org.mozilla.javascript.JavaScriptException
call in interface org.mozilla.javascript.Callablecall in interface org.mozilla.javascript.Functionorg.mozilla.javascript.JavaScriptExceptionpublic final org.mozilla.javascript.Scriptable construct(org.mozilla.javascript.Context arg0,
org.mozilla.javascript.Scriptable arg1,
Object[] arg2)
throws org.mozilla.javascript.JavaScriptException
construct in interface org.mozilla.javascript.Functionorg.mozilla.javascript.JavaScriptExceptionpublic final Object get(int index, org.mozilla.javascript.Scriptable start)
get in interface org.mozilla.javascript.Scriptableget in class org.mozilla.javascript.ScriptableObjectprotected Object getWithPreemption(String name)
Scriptable.NOT_FOUND is returned.
Called by SimpleScriptable.get(String, Scriptable) to allow retrieval of the property before the prototype
chain is searched.
IMPORTANT: This method is invoked *very* often by Rhino. If you override this method, the implementation needs to be as fast as possible!
getWithPreemption in class SimpleScriptablename - the property nameScriptable.NOT_FOUND if not foundpublic final int jsxGet_length()
public final Object jsxFunction_item(Object index)
index - The index or key corresponding to the element or elements to return.public final Object jsxFunction_namedItem(String name)
name - The name or id the element or elements to return.public final Object jsxFunction_tags(String tagName)
tagName - The name of the tag of the elements to return.protected Object equivalentValues(Object other)
equivalentValues in class org.mozilla.javascript.ScriptableObjectpublic boolean has(String name, org.mozilla.javascript.Scriptable start)
has in interface org.mozilla.javascript.Scriptablehas in class org.mozilla.javascript.ScriptableObjectpublic Object[] getIds()
getIds in interface org.mozilla.javascript.ScriptablegetIds in class org.mozilla.javascript.ScriptableObjectCopyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.