Package org.mozilla.javascript
Class LambdaAccessorSlot
java.lang.Object
org.mozilla.javascript.Slot
org.mozilla.javascript.LambdaAccessorSlot
- All Implemented Interfaces:
Serializable
A specialized property accessor using lambda functions, similar to
LambdaSlot
, but allows
defining properties with getter and setter lambdas that require access to the owner object
('this'). This enables the implementation of properties that can access instance fields of the
owner.
Unlike LambdaSlot
, Lambda functions used to define getter and setter logic require the
owner's `Scriptable` object as one of the parameters. This is particularly useful for
implementing properties that behave like standard JavaScript properties, but are implemented with
native functionality without the need for reflection.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetValue
(Scriptable owner) void
setGetter
(Scriptable scope, Function<Scriptable, Object> getter) void
setSetter
(Scriptable scope, BiConsumer<Scriptable, Object> setter) boolean
setValue
(Object value, Scriptable scope, Scriptable start, boolean isThrow) Methods inherited from class org.mozilla.javascript.Slot
setValue, throwNoSetterException