public class DOMTokenList extends HtmlUnitScriptable
DOMTokenList
.org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_FOUND
Constructor and Description |
---|
DOMTokenList()
Creates an instance.
|
DOMTokenList(Node node,
String attributeName)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String token)
Adds the specified token to the underlying string.
|
boolean |
contains(String token)
Checks if the specified token is contained in the underlying string.
|
org.htmlunit.corejs.javascript.Scriptable |
entries()
Returns an Iterator allowing to go through all key/value pairs contained in this object.
|
void |
forEach(Object callback)
Calls the
callback given in parameter once for each value in the list. |
Object |
get(int index,
org.htmlunit.corejs.javascript.Scriptable start) |
String |
getDefaultValue(Class<?> hint)
Returns the JavaScript default value of this object.
|
Object[] |
getIds()
.
|
int |
getLength()
Returns the length property.
|
String |
getValue() |
Object |
item(int index)
Returns the item at the specified index.
|
void |
jsConstructor()
JavaScript constructor.
|
org.htmlunit.corejs.javascript.Scriptable |
keys()
Returns an Iterator allowing to go through all keys contained in this object.
|
void |
remove(String token)
Removes the specified token from the underlying string.
|
boolean |
replace(String oldToken,
String newToken)
Replaces an existing token with a new token.
|
void |
setValue(String value) |
boolean |
toggle(String token)
Toggle the token, by adding or removing.
|
org.htmlunit.corejs.javascript.Scriptable |
values()
Returns an Iterator allowing to go through all keys contained in this object.
|
clone, equivalentValues, get, getBrowserVersion, getClassName, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getWindow, getWindow, getWindowFromTopCallScope, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
public void jsConstructor()
public String getValue()
public void setValue(String value)
value
- the new valuepublic int getLength()
public String getDefaultValue(Class<?> hint)
getDefaultValue
in interface org.htmlunit.corejs.javascript.Scriptable
getDefaultValue
in class HtmlUnitScriptable
hint
- a hint as to the format of the default value (ignored in this case)public void add(String token)
token
- the token to addpublic void remove(String token)
token
- the token to removepublic boolean replace(String oldToken, String newToken)
oldToken
- a string representing the token you want to replacenewToken
- a string representing the token you want to replace oldToken withpublic boolean toggle(String token)
token
- the token to add or removepublic boolean contains(String token)
token
- the token to addpublic Object item(int index)
index
- the index of the itempublic org.htmlunit.corejs.javascript.Scriptable keys()
public Object[] getIds()
getIds
in interface org.htmlunit.corejs.javascript.Scriptable
getIds
in class org.htmlunit.corejs.javascript.ScriptableObject
public org.htmlunit.corejs.javascript.Scriptable values()
public org.htmlunit.corejs.javascript.Scriptable entries()
public void forEach(Object callback)
callback
given in parameter once for each value in the list.callback
- function to execute for each elementpublic Object get(int index, org.htmlunit.corejs.javascript.Scriptable start)
get
in interface org.htmlunit.corejs.javascript.Scriptable
get
in class org.htmlunit.corejs.javascript.ScriptableObject
Copyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.