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, setHtmlElement
associateValue, 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, setPrototype
public 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.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, Object[] arg2) throws org.mozilla.javascript.JavaScriptException
construct
in interface org.mozilla.javascript.Function
org.mozilla.javascript.JavaScriptException
public final Object get(int index, org.mozilla.javascript.Scriptable start)
get
in interface org.mozilla.javascript.Scriptable
get
in class org.mozilla.javascript.ScriptableObject
protected 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 SimpleScriptable
name
- 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.ScriptableObject
public boolean has(String name, org.mozilla.javascript.Scriptable start)
has
in interface org.mozilla.javascript.Scriptable
has
in class org.mozilla.javascript.ScriptableObject
public Object[] getIds()
getIds
in interface org.mozilla.javascript.Scriptable
getIds
in class org.mozilla.javascript.ScriptableObject
Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.