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.xml.FormData
- 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
FormData.- Author:
- Ahmed Ashour, Ronald Brill, Thorsten Wendelmuth
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classIterator support forFormData.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 value for an existing key, or adds the key if it does not already exist.voidRemoves the entry with the given name, if it exists.org.htmlunit.corejs.javascript.Scriptableentries()Returns an iterator over all name/value pairs contained in thisFormData.voidfillRequest(WebRequest webRequest) Populates the givenWebRequestwith the parameters from thisFormData.voidIterates over all key/value pairs in thisFormData, calling the given callback for each.Returns the first value associated with the given name.org.htmlunit.corejs.javascript.ScriptableReturns all values associated with the given name.booleanReturns whether an entry with the given name exists.voidjsConstructor(Object formObj) Creates an instance of this object, optionally pre-populated from the given form.keys()Returns an iterator over all keys in thisFormData.voidSets a new value for an existing key, replacing all existing values for that key, or adds the key if it does not already exist.values()Returns an iterator over all values in thisFormData.Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, 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, 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
-
FormData
public FormData()
-
-
Method Details
-
jsConstructor
Creates an instance of this object, optionally pre-populated from the given form.- Parameters:
formObj- anHTMLFormElementto initialize the data from, orundefined
-
append
Appends a new value for an existing key, or adds the key if it does not already exist.- Parameters:
name- the name of the fieldvalue- the field's valuefilename- the filename reported to the server (optional)
-
delete_js
Removes the entry with the given name, if it exists.- Parameters:
name- the name of the field to remove
-
get
Returns the first value associated with the given name.- Parameters:
name- the name of the field to retrieve- Returns:
- the first value found, or
nullif not found
-
getAll
Returns all values associated with the given name.- Parameters:
name- the name of the field to retrieve- Returns:
- an array of all values found for the given name
-
has
Returns whether an entry with the given name exists.- Parameters:
name- the name of the field to check- Returns:
trueif the name exists,falseotherwise
-
set
Sets a new value for an existing key, replacing all existing values for that key, or adds the key if it does not already exist.- Parameters:
name- the name of the fieldvalue- the field's valuefilename- the filename reported to the server (optional)
-
entries
public org.htmlunit.corejs.javascript.Scriptable entries()Returns an iterator over all name/value pairs contained in thisFormData.- Returns:
- an iterator of
[name, value]arrays
-
fillRequest
Populates the givenWebRequestwith the parameters from thisFormData.- Parameters:
webRequest- the web request to fill
-
forEach
Iterates over all key/value pairs in thisFormData, calling the given callback for each.- Parameters:
callback- the function to execute for each key/value pair
-
keys
Returns an iterator over all keys in thisFormData.- Returns:
- an iterator of key strings
-
values
Returns an iterator over all values in thisFormData.- Returns:
- an iterator of value strings
-