public class NashornBindingsParametersCallback extends BindingsParametersCallback
Bindings for Java 8 JavaScript engine "Nashorn".
See Nashorn engine notes
for reasoning. In essence, Nashorn expects Bindings to be an instance of
jdk.nashorn.api.scripting.ScriptObjectMirror, otherwise it puts "nashorn.global" variable inside and use it
to store all variables. This makes the interface pretty unusable and requires some tricks implemented below
| Constructor and Description |
|---|
NashornBindingsParametersCallback(ParametersCallback parentParameters) |
NashornBindingsParametersCallback(ParametersCallback parentParameters,
QueryCallback queryCallback) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(Object key) |
Object |
get(Object key)
|
Object |
getParameter(String name)
Returns specified variable value.
|
Object |
put(String key,
Object value)
Sets local variable.
|
clear, containsValue, entrySet, isEmpty, isNextCalled, keySet, next, putAll, remove, setQueryCallback, size, valuesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclear, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, valuespublic NashornBindingsParametersCallback(ParametersCallback parentParameters)
public NashornBindingsParametersCallback(ParametersCallback parentParameters, QueryCallback queryCallback)
public Object getParameter(String name)
ParametersCallbackMapThe local variables set by ParametersCallbackMap.put(String,Object) method
take priority of variables in parentParameters object.
getParameter in interface ParametersCallbackgetParameter in class ParametersCallbackMapname - variable namepublic Object get(Object key)
ParametersCallbackMappublic boolean containsKey(Object key)
containsKey in interface Map<String,Object>containsKey in interface BindingscontainsKey in class ParametersCallbackMappublic Object put(String key, Object value)
ParametersCallbackMapCopyright © 2006–2019. All rights reserved.