Package org.htmlunit.corejs.javascript
Class AccessorSlot
- java.lang.Object
-
- org.htmlunit.corejs.javascript.Slot
-
- org.htmlunit.corejs.javascript.AccessorSlot
-
- All Implemented Interfaces:
java.io.Serializable
public class AccessorSlot extends Slot
This is a specialization of Slot to store various types of values that are retrieved dynamically using Java and JavaScript functions. Unlike LambdaSlot, the fact that these values are accessed and mutated by functions is visible via the slot's property descriptor.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classAccessorSlot.FunctionGetterThis is a getter that delegates to a JavaScript function.(package private) static classAccessorSlot.FunctionSetterInvoke the setter as a JavaScript function, taking care that it might actually be Undefined.(package private) static interfaceAccessorSlot.Getter(package private) static classAccessorSlot.MemberBoxGetterThis is a Getter that delegates to a Java function via a MemberBox.(package private) static classAccessorSlot.MemberBoxSetterInvoke the setter on this slot via reflection using MemberBox.(package private) static interfaceAccessorSlot.Setter
-
Field Summary
Fields Modifier and Type Field Description (package private) AccessorSlot.Gettergetterprivate static longserialVersionUID(package private) AccessorSlot.Settersetter-
Fields inherited from class org.htmlunit.corejs.javascript.Slot
indexOrHash, name, next, orderedNext, value
-
-
Constructor Summary
Constructors Constructor Description AccessorSlot(Slot oldSlot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) FunctiongetGetterFunction(java.lang.String name, Scriptable scope)Same for the "getter."(package private) ScriptableObjectgetPropertyDescriptor(Context cx, Scriptable scope)(package private) FunctiongetSetterFunction(java.lang.String name, Scriptable scope)Return a JavaScript function that represents the "setter".java.lang.ObjectgetValue(Scriptable start)(package private) booleanisSetterSlot()Return true if this is a "setter slot" which, which we need to know for some legacy support.(package private) booleanisValueSlot()Return true if this is a base-class "Slot".booleansetValue(java.lang.Object value, Scriptable owner, Scriptable start, boolean isThrow)-
Methods inherited from class org.htmlunit.corejs.javascript.Slot
getAttributes, setAttributes, setValue, throwNoSetterException
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
getter
AccessorSlot.Getter getter
-
setter
AccessorSlot.Setter setter
-
-
Constructor Detail
-
AccessorSlot
AccessorSlot(Slot oldSlot)
-
-
Method Detail
-
isValueSlot
boolean isValueSlot()
Description copied from class:SlotReturn true if this is a base-class "Slot". Sadly too much code breaks if we try to do this any other way.- Overrides:
isValueSlotin classSlot
-
isSetterSlot
boolean isSetterSlot()
Description copied from class:SlotReturn true if this is a "setter slot" which, which we need to know for some legacy support.- Overrides:
isSetterSlotin classSlot
-
getPropertyDescriptor
ScriptableObject getPropertyDescriptor(Context cx, Scriptable scope)
- Overrides:
getPropertyDescriptorin classSlot
-
setValue
public boolean setValue(java.lang.Object value, Scriptable owner, Scriptable start, boolean isThrow)
-
getValue
public java.lang.Object getValue(Scriptable start)
-
getSetterFunction
Function getSetterFunction(java.lang.String name, Scriptable scope)
Description copied from class:SlotReturn a JavaScript function that represents the "setter". This is used by some legacy functionality. Return null if there is no setter.- Overrides:
getSetterFunctionin classSlot
-
getGetterFunction
Function getGetterFunction(java.lang.String name, Scriptable scope)
Description copied from class:SlotSame for the "getter."- Overrides:
getGetterFunctionin classSlot
-
-