org.apache.tinkerpop.gremlin.jsr223

## Class JavaTranslator<S extends TraversalSource,T extends Traversal.Admin<?,?>>

- java.lang.Object
- - org.apache.tinkerpop.gremlin.jsr223.JavaTranslator<S,T>

- All Implemented Interfaces:
    Translator<S,T>, Translator.StepTranslator<S,T>

      public final class JavaTranslator<S extends TraversalSource,T extends Traversal.Admin<?,?>>
      extends Object
      implements Translator.StepTranslator<S,T>

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

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Translator

      `Translator.ScriptTranslator, Translator.StepTranslator<S extends TraversalSource,T extends Traversal.Admin<?,?>>`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getTargetLanguage()` Get the language that the translator is converting the traversal byte code to.
    `S` | `getTraversalSource()` Get the `TraversalSource` representation rooting this translator.
    `static <S extends TraversalSource,T extends Traversal.Admin<?,?>> JavaTranslator<S,T>` | `of(S traversalSource)`
    `String` | `toString()`
    `T` | `translate(Bytecode bytecode)` Translate `Bytecode` into a new representation.

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

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

- - ### Method Detail

    - #### of

          public static <S extends TraversalSource,T extends Traversal.Admin<?,?>> JavaTranslator<S,T> of(S traversalSource)

    - #### getTraversalSource

          public S getTraversalSource()

      Description copied from interface: `Translator`
      Get the `TraversalSource` representation rooting this translator. For string-based translators (`Translator.ScriptTranslator`), this is typically a "g". For java-based translators (`Translator.StepTranslator`), this is typically the `TraversalSource` instance which the `Traversal` will be built from.
      Specified by:
        `getTraversalSource` in interface `Translator<S extends TraversalSource,T extends Traversal.Admin<?,?>>`
      Returns:
        the traversal source representation

    - #### translate

          public T translate(Bytecode bytecode)

      Description copied from interface: `Translator`
      Translate `Bytecode` into a new representation. Typically, for language translations, the translation is to a string represenging the traversal in the respective scripting language.
      Specified by:
        `translate` in interface `Translator<S extends TraversalSource,T extends Traversal.Admin<?,?>>`
      Parameters:
        `bytecode` - the byte code representing traversal source and traversal manipulations.
      Returns:
        the translated object

    - #### getTargetLanguage

          public String getTargetLanguage()

      Description copied from interface: `Translator`
      Get the language that the translator is converting the traversal byte code to.
      Specified by:
        `getTargetLanguage` in interface `Translator<S extends TraversalSource,T extends Traversal.Admin<?,?>>`
      Returns:
        the language of the translation

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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