Package com.axelor.script
Class JavaScriptValues
java.lang.Object
com.axelor.script.JavaScriptValues
Converts GraalVM guest
Values into plain, context-independent Java objects.
Shallow conversion via v.as(List.class) / v.as(Map.class) yields a live proxy
bound to the polyglot context that produced it; once that context closes, any access throws
"Context is already closed". This converter eagerly materialises arrays and objects into plain
ArrayList/LinkedHashMap, so results are safe to read after the context is gone.
-
Method Details
-
toHost
Deep-convert a guestValueto a durable, context-independent Java object. -
materialize
Deep-copy a host object graph into durable collections. Guest object/array literals passed to host methods (e.g.response.setValue('field', {id: 1})) become liveMap/Listproxies bound to the polyglot context; this copies them into plainLinkedHashMap/ArrayListwhile the context is open, so they survive its close. Non-collection values are already durable and returned as-is.
-