|
||||||||||
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.NodeList
com.gargoylesoftware.htmlunit.javascript.host.html.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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.javascript.host.NodeList |
---|
NodeList.EffectOnCache |
Field Summary |
---|
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 | |
---|---|
HTMLCollection()
Deprecated. |
|
HTMLCollection(DomNode parentScope,
boolean attributeChangeSensitive,
String description)
Creates an instance. |
Method Summary | |
---|---|
protected void |
addElementIds(List<String> idList,
List<Object> elements)
Adds the ids of the collection's elements to the idList. |
protected List<Object> |
computeElements()
Returns the elements whose associated host objects are available through this collection. |
static HTMLCollection |
emptyCollection(Window window)
Gets an empty collection. |
protected Object |
equivalentValues(Object other)
Called for the js "==". |
protected Iterable<DomNode> |
getCandidates()
Gets the DOM node that have to be examined to see if they are matching. |
String |
getClassName()
Returns the JavaScript class name. |
Object[] |
getIds()
. |
protected net.sourceforge.htmlunit.corejs.javascript.Scriptable |
getScriptableForElement(Object object)
Gets the scriptable for the provided element that may already be the right scriptable. |
protected Object |
getWithPreemption(String name)
Returns the element or elements that match the specified key. |
boolean |
has(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
|
protected boolean |
isMatching(DomNode node)
Indicates if the node should belong to the collection. |
Object |
namedItem(String name)
Retrieves the item or items corresponding to the specified name (checks ids, and if that does not work, then names). |
Object |
nextNode()
Returns the next node in the collection (supporting iteration in IE only). |
void |
reset()
Resets the node iterator accessed via nextNode() . |
Object |
tags(String tagName)
Returns all the elements in this element array that have the specified tag name. |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.NodeList |
---|
avoidObjectDetection, call, construct, get, getEffectOnCache, getElements, getLength, item, item, setAvoidObjectDetection, toString |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
---|
clone, defineFunctionProperties, defineProperty, get, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement |
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
applyDescriptorToAttributeBitset, associateValue, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable |
---|
delete, delete, get, getDefaultValue, getParentScope, getPrototype, has, hasInstance, put, put, setParentScope, setPrototype |
Constructor Detail |
---|
@Deprecated public HTMLCollection()
public HTMLCollection(DomNode parentScope, boolean attributeChangeSensitive, String description)
parentScope
- parent scopeattributeChangeSensitive
- indicates if the content of the collection may change when an attribute
of a descendant node of parentScope changes (attribute added, modified or removed)description
- a text useful for debuggingMethod Detail |
---|
public static HTMLCollection emptyCollection(Window window)
window
- the current scope
protected List<Object> computeElements()
computeElements
in class NodeList
protected Iterable<DomNode> getCandidates()
getCandidates
in class NodeList
protected boolean isMatching(DomNode node)
isMatching
in class NodeList
node
- the node to test. Will be a child node of the reference node.
false
here as subclasses for concrete collections should decide it.protected Object getWithPreemption(String name)
Scriptable.NOT_FOUND
is returned.
Returns the element or elements that match the specified key. If it is the name
of a property, the property value is returned. If it is the id of an element in
the array, that element is returned. Finally, if it is the name of an element or
elements in the array, then all those elements are returned. Otherwise,
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 NodeList
name
- the property name
Scriptable.NOT_FOUND
if not foundpublic final Object namedItem(String name)
name
- the name or id the element or elements to return
public Object nextNode()
public void reset()
nextNode()
.
public Object tags(String tagName)
tagName
- the name of the tag of the elements to return
protected Object equivalentValues(Object other)
equivalentValues
in class NodeList
public boolean has(String name, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
has
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
has
in class NodeList
public Object[] getIds()
getIds
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
getIds
in class NodeList
protected void addElementIds(List<String> idList, List<Object> elements)
addElementIds
in class NodeList
idList
- the list to add the ids toelements
- the collection's elementsprotected net.sourceforge.htmlunit.corejs.javascript.Scriptable getScriptableForElement(Object object)
getScriptableForElement
in class NodeList
object
- the object for which to get the scriptable
public String getClassName()
getClassName
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
getClassName
in class NodeList
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |