/** * Evaluates {@link Traversal} {@link Bytecode} against a traversal source in the global bindings of the * {@code ScriptEngine}. * * @param bytecode of the traversal to execute * @param traversalSource to execute the bytecode against which should be in the available bindings. */ public default Traversal.Admin eval(final Bytecode bytecode, final String traversalSource) throws ScriptException { final Bindings bindings = this.createBindings(); bindings.putAll(bytecode.getBindings()); return eval(bytecode, bindings, traversalSource); }
final Bindings bindings = scriptEngine.createBindings(); bindings.putAll(scriptEngine.getContext().getBindings(ScriptContext.ENGINE_SCOPE)); bindings.put(this.translator.getTraversalSource().toString(), this.traversalSource);
/** * Evaluates {@link Traversal} {@link Bytecode} against a traversal source in the global bindings of the * {@code ScriptEngine}. * * @param bytecode of the traversal to execute * @param traversalSource to execute the bytecode against which should be in the available bindings. */ public default Traversal.Admin eval(final Bytecode bytecode, final String traversalSource) throws ScriptException { final Bindings bindings = this.createBindings(); bindings.putAll(bytecode.getBindings()); return eval(bytecode, bindings, traversalSource); }
final Bindings bindings = scriptEngine.createBindings(); bindings.putAll(scriptEngine.getContext().getBindings(ScriptContext.ENGINE_SCOPE)); bindings.put(this.translator.getTraversalSource().toString(), this.traversalSource);