org.apache.tinkerpop.gremlin.jsr223

## 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 the `GremlinScriptEngine` which can be used to help test plugin implementations which don't have reference to a `GremlinScriptEngine` 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 and Description
    `MockGremlinScriptEngine()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Bindings` | `createBindings()`
    `Traversal.Admin` | `eval(Bytecode bytecode, Bindings bindings, String traversalSource)` Evaluates `Traversal` `Bytecode` with the specified `Bindings`.
    `Object` | `eval(Reader reader, ScriptContext context)`
    `Object` | `eval(String script, ScriptContext context)`
    `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, eval, eval`

    - ### Methods inherited from interface javax.script.ScriptEngine

      `eval, eval, eval, eval, get, getBindings, getContext, put, setBindings, setContext`

- - ### Constructor Detail

    - #### MockGremlinScriptEngine

          public MockGremlinScriptEngine()

  - ### Method Detail

    - #### getFactory

          public GremlinScriptEngineFactory getFactory()

      Specified by:
        `getFactory` in interface `ScriptEngine`
      Specified by:
        `getFactory` in interface `GremlinScriptEngine`

    - #### eval

          public Object eval(String script,
                             ScriptContext context)
                      throws ScriptException

      Specified by:
        `eval` in interface `ScriptEngine`
      Throws:
        `ScriptException`

    - #### eval

          public Object eval(Reader reader,
                             ScriptContext context)
                      throws ScriptException

      Specified by:
        `eval` in interface `ScriptEngine`
      Throws:
        `ScriptException`

    - #### eval

          public Traversal.Admin eval(Bytecode bytecode,
                                      Bindings bindings,
                                      String traversalSource)
                               throws ScriptException

      Description copied from interface: `GremlinScriptEngine`
      Evaluates `Traversal` `Bytecode` with the specified `Bindings`. These `Bindings` supplied to this method will be merged with global engine bindings and override them where keys match.
      Specified by:
        `eval` in interface `GremlinScriptEngine`
      Throws:
        `ScriptException`

    - #### createBindings

          public Bindings createBindings()

      Specified by:
        `createBindings` in interface `ScriptEngine`

Copyright © 2013–2019 Apache Software Foundation. All rights reserved.