Re: Is there a way to reference the engine from a linker?

2018-04-04 Thread Attila Szegedi
Oh, good one. Yes, I think that’ll do. It engages Nashorn’s built-in linker chain to find an appropriate conversion. Attila. > On 2018. Apr 4., at 19:28, Paulo Lopes wrote: > > Hi, > > I've worked around it by using: > > > ScriptUtils.convert(obj, Map.class) > > >

Re: Is there a way to reference the engine from a linker?

2018-04-04 Thread Paulo Lopes
Hi, I've worked around it by using: ScriptUtils.convert(obj, Map.class) When ever I needed to get a script object as a map or replacing the class with List.class when I need a list... Is that a safe way to do it?   Original Message   From: szege...@gmail.com Sent: April 4, 2018 7:21 PM

Re: Is there a way to reference the engine from a linker?

2018-04-04 Thread Attila Szegedi
Sorry for an awfully late response, but hope it might still help: Java.asJSONCompatible delegates on the Java side to jdk.nashorn.api.scripting.wrapAsJSONCompatible. It’s part of Nashorn’s supported public API, so it should be fine for you to call it. I’m actually wondering how useful is that

Re: Is there a way to reference the engine from a linker?

2018-03-15 Thread Sundararajan Athijegannathan
Hi, Dynalink and its pluggable linkers are independent of Nashorn. If you want to access the current engine, you've to arrange to pass it. Thanks, -Sundar On 16/03/18, 12:32 AM, Paulo Lopes wrote: Hi, I'm writing a guarded linker to allow custom casting from JSObject to Vertx custom types.