Code example for SimpleBindings

Methods: putAll

0
 
    public static ScriptEngine createGremlinScriptEngine(Map<String, Object> context) {
        try { 
            ScriptEngine engine = new GremlinGroovyScriptEngine();
 
            Bindings bindings = new SimpleBindings();
            bindings.putAll(context);
 
            engine.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
 
            return engine;
        } catch (Throwable e) {
            // Pokemon catch b/c fails here get hidden until the server exits. 
            e.printStackTrace();
            return null; 
        } 
    } 
 
    protected synchronized void ensureInitiated() { 
        if (initiated == false) {
Connect your IDE to all the code out there  Get Codota for Java