java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.URLSearchParams
- All Implemented Interfaces:
Serializable,Cloneable,org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.debug.DebuggableObject,org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.Scriptable,org.htmlunit.corejs.javascript.SymbolScriptable
JavaScript host object for
URLSearchParams.- Author:
- Ahmed Ashour, Ronald Brill, Ween Jiann, cd alexndr, Lai Quang Duong
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classES6Iteratorimplementation for JavaScript support.Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction -
Field Summary
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
isSealedFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends a new key/value pair as a search parameter.voidDeletes the given search parameter and all its associated values.org.htmlunit.corejs.javascript.ES6Iteratorentries()Returns an iterator over all key/value pairs in this object.voidfillRequest(WebRequest webRequest) Populates the givenWebRequestwith the parameters from this object.voidIterates over all key/value pairs, calling the given callback for each.Returns the first value associated with the given search parameter.org.htmlunit.corejs.javascript.ScriptableReturns all values associated with the given search parameter.getDefaultValue(Class<?> hint) Returns the default string representation of this object.intgetSize()Returns the total number of search parameter entries.booleanReturns whether a parameter with the given name exists.voidjsConstructor(Object params) Creates an instance of this object.Returns the URL-encoded string representation of this search params object.org.htmlunit.corejs.javascript.ES6Iteratorkeys()Returns an iterator over all keys in this object.voidSets the value associated with the given search parameter, replacing all existing values.org.htmlunit.corejs.javascript.ES6Iteratorvalues()Returns an iterator over all values in this object.Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getWindow, getWindow, getWindowOrWorkerGlobalScope, getWithPreemption, has, hasInstance, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setupPromise, setupRejectedPromiseMethods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, sizeMethods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, defineProperty, defineProperty, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMapsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.htmlunit.corejs.javascript.Scriptable
get, getIds, has, hasMethods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable
get, has
-
Constructor Details
-
URLSearchParams
public URLSearchParams()Default constructor.
-
-
Method Details
-
jsConstructor
Creates an instance of this object.- Parameters:
params- initial search parameters; may be a string, a sequence of[name, value]pairs, or a record object
-
append
Appends a new key/value pair as a search parameter.- Parameters:
name- the name of the parameter to appendvalue- the value of the parameter to append
-
delete
Deletes the given search parameter and all its associated values.- Specified by:
deletein interfaceorg.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>- Specified by:
deletein interfaceorg.htmlunit.corejs.javascript.Scriptable- Overrides:
deletein classorg.htmlunit.corejs.javascript.ScriptableObject- Parameters:
name- the name of the parameter to delete
-
get
Returns the first value associated with the given search parameter.- Parameters:
name- the name of the parameter to find- Returns:
- the first value for the given name, or
nullif not found
-
getAll
Returns all values associated with the given search parameter.- Parameters:
name- the name of the parameter to find- Returns:
- an array of all values for the given name
-
set
Sets the value associated with the given search parameter, replacing all existing values. If the parameter does not exist, it is appended.- Parameters:
name- the name of the parameter to setvalue- the new value
-
has
Returns whether a parameter with the given name exists.- Parameters:
name- the name of the parameter to check- Returns:
trueif the parameter exists,falseotherwise
-
forEach
Iterates over all key/value pairs, calling the given callback for each.- Parameters:
callback- the function to call for each key/value pair
-
entries
public org.htmlunit.corejs.javascript.ES6Iterator entries()Returns an iterator over all key/value pairs in this object. Keys and values areUSVStringobjects.- Returns:
- an iterator of
[name, value]arrays
-
keys
public org.htmlunit.corejs.javascript.ES6Iterator keys()Returns an iterator over all keys in this object.- Returns:
- an iterator of key strings
-
values
public org.htmlunit.corejs.javascript.ES6Iterator values()Returns an iterator over all values in this object.- Returns:
- an iterator of value strings
-
getSize
public int getSize()Returns the total number of search parameter entries.- Returns:
- the number of entries
-
jsToString
Returns the URL-encoded string representation of this search params object.- Returns:
- the encoded query string
-
getDefaultValue
Returns the default string representation of this object.- Specified by:
getDefaultValuein interfaceorg.htmlunit.corejs.javascript.Scriptable- Overrides:
getDefaultValuein classHtmlUnitScriptable- Parameters:
hint- the type hint- Returns:
- the URL-encoded query string
- See Also:
-
fillRequest
Populates the givenWebRequestwith the parameters from this object.- Parameters:
webRequest- the web request to fill
-