org.apache.tinkerpop.gremlin.groovy.util

## Class TestableConsolePluginAcceptor

- java.lang.Object
- - org.apache.tinkerpop.gremlin.groovy.util.TestableConsolePluginAcceptor

- All Implemented Interfaces:
    PluginAcceptor

      public class TestableConsolePluginAcceptor
      extends Object
      implements PluginAcceptor

  Author:
    Marko A. Rodriguez (http://markorodriguez.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ENVIRONMENT_IO`
    `static String` | `ENVIRONMENT_NAME`
    `static String` | `ENVIRONMENT_SHELL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TestableConsolePluginAcceptor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBinding(String key, Object val)` Add a variable binding for the plugin host.
    `void` | `addImports(Set<String> importStatements)` If the `PluginAcceptor` implements the `DependencyManager` interface it will try to import the specified import statements.
    `Map<String,Object>` | `environment()` Returns a map of implementation specific variables that can be referenced by the plugin.
    `Object` | `eval(String script)` Evaluate a script in the `PluginAcceptor`.
    `Map<String,Object>` | `getBindings()` Gets the list of bindings from the plugin host.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ENVIRONMENT_NAME

          public static final String ENVIRONMENT_NAME

      See Also:
        Constant Field Values

    - #### ENVIRONMENT_SHELL

          public static final String ENVIRONMENT_SHELL

      See Also:
        Constant Field Values

    - #### ENVIRONMENT_IO

          public static final String ENVIRONMENT_IO

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TestableConsolePluginAcceptor

          public TestableConsolePluginAcceptor()

  - ### Method Detail

    - #### addImports

          public void addImports(Set<String> importStatements)

      Description copied from interface: `PluginAcceptor`
      If the `PluginAcceptor` implements the `DependencyManager` interface it will try to import the specified import statements.
      Specified by:
        `addImports` in interface `PluginAcceptor`

    - #### addBinding

          public void addBinding(String key,
                                 Object val)

      Description copied from interface: `PluginAcceptor`
      Add a variable binding for the plugin host.
      Specified by:
        `addBinding` in interface `PluginAcceptor`

    - #### getBindings

          public Map<String,Object> getBindings()

      Description copied from interface: `PluginAcceptor`
      Gets the list of bindings from the plugin host. These bindings will represent the "global" binding list.
      Specified by:
        `getBindings` in interface `PluginAcceptor`

    - #### eval

          public Object eval(String script)
                      throws ScriptException

      Description copied from interface: `PluginAcceptor`
      Evaluate a script in the `PluginAcceptor`.
      Specified by:
        `eval` in interface `PluginAcceptor`
      Throws:
        `ScriptException`

    - #### environment

          public Map<String,Object> environment()

      Description copied from interface: `PluginAcceptor`
      Returns a map of implementation specific variables that can be referenced by the plugin. Those writing plugins should examine the details of the various `PluginAcceptor` implementations for the variables that they pass, as they may provide important information useful to the plugin itself.
      Specified by:
        `environment` in interface `PluginAcceptor`

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