public class HtmlUnitScriptable extends org.htmlunit.corejs.javascript.ScriptableObject implements Cloneable
org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunctionCONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTNOT_FOUND| Constructor and Description |
|---|
HtmlUnitScriptable() |
| Modifier and Type | Method and Description |
|---|---|
HtmlUnitScriptable |
clone() |
protected Object |
equivalentValues(Object value) |
Object |
get(String name,
org.htmlunit.corejs.javascript.Scriptable start)
Gets a named property from the object.
|
BrowserVersion |
getBrowserVersion()
Gets the browser version currently used.
|
String |
getClassName()
Returns the JavaScript class name.
|
Object |
getDefaultValue(Class<?> hint)
Returns the JavaScript default value of this object.
|
DomNode |
getDomNodeOrDie()
Returns the DOM node that corresponds to this JavaScript object or throw
an exception if one cannot be found.
|
DomNode |
getDomNodeOrNull()
Returns the DOM node that corresponds to this JavaScript object
or null if a node hasn't been set.
|
org.htmlunit.corejs.javascript.Scriptable |
getPrototype(Class<? extends HtmlUnitScriptable> javaScriptClass)
Gets the prototype object for the given host class.
|
protected HtmlUnitScriptable |
getScriptableFor(Object object)
Returns the JavaScript object that corresponds to the specified object.
|
Window |
getWindow()
Gets the window that is the top scope for this object.
|
protected static Window |
getWindow(org.htmlunit.corejs.javascript.Scriptable s)
Gets the window that is the top scope for the specified object.
|
protected static Window |
getWindowFromTopCallScope()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
protected Object |
getWithPreemption(String name)
Called by
get(String, Scriptable) to allow retrieval of the property before the prototype
chain is searched. |
boolean |
has(int index,
org.htmlunit.corejs.javascript.Scriptable start) |
boolean |
hasInstance(org.htmlunit.corejs.javascript.Scriptable instance) |
protected void |
initParentScope(DomNode domNode,
HtmlUnitScriptable scriptable)
Initialize the parent scope of a newly created scriptable.
|
HtmlUnitScriptable |
makeScriptableFor(DomNode domNode)
Builds a new the JavaScript object that corresponds to the specified object.
|
void |
put(String name,
org.htmlunit.corejs.javascript.Scriptable start,
Object value) |
void |
setClassName(String className)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
setDomNode(DomNode domNode)
Sets the DOM node that corresponds to this JavaScript object.
|
void |
setDomNode(DomNode domNode,
boolean assignScriptObject)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
setParentScope(org.htmlunit.corejs.javascript.Scriptable m) |
protected org.htmlunit.corejs.javascript.NativePromise |
setupPromise(org.apache.commons.lang3.function.FailableSupplier<Object,IOException> resolver) |
protected org.htmlunit.corejs.javascript.NativePromise |
setupRejectedPromise(Supplier<Object> resolver) |
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkSlotRemoval, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, 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, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, sizecreateSlotMappublic String getClassName()
getClassName in interface org.htmlunit.corejs.javascript.ScriptablegetClassName in class org.htmlunit.corejs.javascript.ScriptableObjectpublic void setClassName(String className)
className - the class name.public void setParentScope(org.htmlunit.corejs.javascript.Scriptable m)
setParentScope in interface org.htmlunit.corejs.javascript.ScriptablesetParentScope in class org.htmlunit.corejs.javascript.ScriptableObjectpublic void put(String name, org.htmlunit.corejs.javascript.Scriptable start, Object value)
put in interface org.htmlunit.corejs.javascript.Scriptableput in class org.htmlunit.corejs.javascript.ScriptableObjectpublic Object get(String name, org.htmlunit.corejs.javascript.Scriptable start)
getWithPreemption(String).
get in interface org.htmlunit.corejs.javascript.Scriptableget in class org.htmlunit.corejs.javascript.ScriptableObjectprotected Object getWithPreemption(String name)
Called by 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!
name - the property nameScriptable.NOT_FOUND if not foundpublic boolean has(int index,
org.htmlunit.corejs.javascript.Scriptable start)
has in interface org.htmlunit.corejs.javascript.Scriptablehas in class org.htmlunit.corejs.javascript.ScriptableObjectpublic DomNode getDomNodeOrDie()
public DomNode getDomNodeOrNull()
public void setDomNode(DomNode domNode)
domNode - the DOM nodepublic void setDomNode(DomNode domNode, boolean assignScriptObject)
domNode - the DOM nodeassignScriptObject - If true, call setScriptObject on domNodeprotected HtmlUnitScriptable getScriptableFor(Object object)
public HtmlUnitScriptable makeScriptableFor(DomNode domNode)
domNode - the DOM node for which a JS object should be createdprotected void initParentScope(DomNode domNode, HtmlUnitScriptable scriptable)
domNode - the DOM node for the script objectscriptable - the script object to initializepublic org.htmlunit.corejs.javascript.Scriptable getPrototype(Class<? extends HtmlUnitScriptable> javaScriptClass)
javaScriptClass - the host classpublic Object getDefaultValue(Class<?> hint)
getDefaultValue in interface org.htmlunit.corejs.javascript.ScriptablegetDefaultValue in class org.htmlunit.corejs.javascript.ScriptableObjecthint - a hint as to the format of the default value (ignored in this case)public Window getWindow() throws RuntimeException
RuntimeException - if the window cannot be found, which should never occurprotected static Window getWindow(org.htmlunit.corejs.javascript.Scriptable s) throws RuntimeException
s - the JavaScript object whose associated window is to be returnedRuntimeException - if the window cannot be found, which should never occurprotected static Window getWindowFromTopCallScope() throws RuntimeException
RuntimeExceptionpublic BrowserVersion getBrowserVersion()
public boolean hasInstance(org.htmlunit.corejs.javascript.Scriptable instance)
hasInstance in interface org.htmlunit.corejs.javascript.ScriptablehasInstance in class org.htmlunit.corejs.javascript.ScriptableObjectprotected Object equivalentValues(Object value)
equivalentValues in class org.htmlunit.corejs.javascript.ScriptableObjectpublic HtmlUnitScriptable clone()
protected org.htmlunit.corejs.javascript.NativePromise setupPromise(org.apache.commons.lang3.function.FailableSupplier<Object,IOException> resolver)
protected org.htmlunit.corejs.javascript.NativePromise setupRejectedPromise(Supplier<Object> resolver)
Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.