Class MockGremlinScriptEngine
- java.lang.Object
-
- javax.script.AbstractScriptEngine
-
- org.apache.tinkerpop.gremlin.jsr223.MockGremlinScriptEngine
-
- All Implemented Interfaces:
ScriptEngine
,GremlinScriptEngine
public class MockGremlinScriptEngine extends AbstractScriptEngine implements GremlinScriptEngine
This is a "do nothing" implementation of theGremlinScriptEngine
which can be used to help test plugin implementations which don't have reference to aGremlinScriptEngine
as a dependency.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Field Summary
-
Fields inherited from class javax.script.AbstractScriptEngine
context
-
Fields inherited from interface org.apache.tinkerpop.gremlin.jsr223.GremlinScriptEngine
HIDDEN_G
-
Fields inherited from interface javax.script.ScriptEngine
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME
-
-
Constructor Summary
Constructors Constructor Description MockGremlinScriptEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bindings
createBindings()
Object
eval(Reader reader, ScriptContext context)
Object
eval(String script, ScriptContext context)
Traversal.Admin
eval(Bytecode bytecode, Bindings bindings, String traversalSource)
GremlinScriptEngineFactory
getFactory()
-
Methods inherited from class javax.script.AbstractScriptEngine
eval, eval, eval, eval, get, getBindings, getContext, getScriptContext, put, setBindings, setContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.tinkerpop.gremlin.jsr223.GremlinScriptEngine
eval
-
Methods inherited from interface javax.script.ScriptEngine
eval, eval, eval, eval, get, getBindings, getContext, put, setBindings, setContext
-
-
-
-
Method Detail
-
getFactory
public GremlinScriptEngineFactory getFactory()
- Specified by:
getFactory
in interfaceGremlinScriptEngine
- Specified by:
getFactory
in interfaceScriptEngine
-
eval
public Object eval(String script, ScriptContext context) throws ScriptException
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
eval
public Object eval(Reader reader, ScriptContext context) throws ScriptException
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
eval
public Traversal.Admin eval(Bytecode bytecode, Bindings bindings, String traversalSource) throws ScriptException
Description copied from interface:GremlinScriptEngine
EvaluatesTraversal
Bytecode
with the specifiedBindings
. TheseBindings
supplied to this method will be merged with global engine bindings and override them where keys match.- Specified by:
eval
in interfaceGremlinScriptEngine
- Throws:
ScriptException
-
createBindings
public Bindings createBindings()
- Specified by:
createBindings
in interfaceScriptEngine
-
-