Package org.mozilla.javascript
Class AccessorSlot
- java.lang.Object
-
- org.mozilla.javascript.Slot
-
- org.mozilla.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 class
AccessorSlot.FunctionGetter
This is a getter that delegates to a JavaScript function.(package private) static class
AccessorSlot.FunctionSetter
Invoke the setter as a JavaScript function, taking care that it might actually be Undefined.(package private) static interface
AccessorSlot.Getter
(package private) static class
AccessorSlot.MemberBoxGetter
This is a Getter that delegates to a Java function via a MemberBox.(package private) static class
AccessorSlot.MemberBoxSetter
Invoke the setter on this slot via reflection using MemberBox.(package private) static interface
AccessorSlot.Setter
-
Field Summary
Fields Modifier and Type Field Description (package private) AccessorSlot.Getter
getter
private static long
serialVersionUID
(package private) AccessorSlot.Setter
setter
-
Fields inherited from class org.mozilla.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) Function
getGetterFunction(java.lang.String name, Scriptable scope)
Same for the "getter."(package private) ScriptableObject
getPropertyDescriptor(Context cx, Scriptable scope)
(package private) Function
getSetterFunction(java.lang.String name, Scriptable scope)
Return a JavaScript function that represents the "setter".java.lang.Object
getValue(Scriptable start)
(package private) boolean
isSetterSlot()
Return true if this is a "setter slot" which, which we need to know for some legacy support.(package private) boolean
isValueSlot()
Return true if this is a base-class "Slot".boolean
setValue(java.lang.Object value, Scriptable owner, Scriptable start)
-
Methods inherited from class org.mozilla.javascript.Slot
getAttributes, setAttributes, throwNoSetterException
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
getter
transient AccessorSlot.Getter getter
-
setter
transient AccessorSlot.Setter setter
-
-
Constructor Detail
-
AccessorSlot
AccessorSlot(Slot oldSlot)
-
-
Method Detail
-
isValueSlot
boolean isValueSlot()
Description copied from class:Slot
Return true if this is a base-class "Slot". Sadly too much code breaks if we try to do this any other way.- Overrides:
isValueSlot
in classSlot
-
isSetterSlot
boolean isSetterSlot()
Description copied from class:Slot
Return true if this is a "setter slot" which, which we need to know for some legacy support.- Overrides:
isSetterSlot
in classSlot
-
getPropertyDescriptor
ScriptableObject getPropertyDescriptor(Context cx, Scriptable scope)
- Overrides:
getPropertyDescriptor
in classSlot
-
setValue
public boolean setValue(java.lang.Object value, Scriptable owner, Scriptable start)
-
getValue
public java.lang.Object getValue(Scriptable start)
-
getSetterFunction
Function getSetterFunction(java.lang.String name, Scriptable scope)
Description copied from class:Slot
Return a JavaScript function that represents the "setter". This is used by some legacy functionality. Return null if there is no setter.- Overrides:
getSetterFunction
in classSlot
-
getGetterFunction
Function getGetterFunction(java.lang.String name, Scriptable scope)
Description copied from class:Slot
Same for the "getter."- Overrides:
getGetterFunction
in classSlot
-
-