Skip to content

ValueAccessor ​

com.jsmacrosce.jsmacros.graal.ValueAccessor

Reflectively accesses the private receiver field of GraalVM Value objects; this is not a general value-conversion API or a public, stable GraalVM interface.
Class initialization locates receiver on Value's superclass and makes its field accessible, so it depends on GraalVM's private field layout and reflective access being permitted. Initialization can fail before getReceiver(Value) is called, including when its argument would be null.

js
const Value = Java.type("org.graalvm.polyglot.Value");  
const Accessor = Java.type("com.jsmacrosce.jsmacros.graal.ValueAccessor");  
const receiver = Accessor.getReceiver(Value.asValue("sample"));

Constructors ​

new ValueAccessor ​

new ValueAccessor()#

Methods ​

getReceiver ​

static getReceiver(Value value): Object#
Returns the receiver stored in the given GraalVM value. Failures invoking the resolved getter are wrapped in RuntimeException.

Parameters:

  • value: GraalVM value to inspect, or null
Returns: the stored receiver, or null when value is null