org.apache.tinkerpop.gremlin.process.traversal.translator

## Class JavascriptTranslator.DefaultTypeTranslator

- java.lang.Object
- - org.apache.tinkerpop.gremlin.process.traversal.Translator.ScriptTranslator.AbstractTypeTranslator
  - - org.apache.tinkerpop.gremlin.process.traversal.translator.JavascriptTranslator.DefaultTypeTranslator

- All Implemented Interfaces:
    BiFunction<String,Object,Script>, Translator.ScriptTranslator.TypeTranslator
  Enclosing class:
    JavascriptTranslator

      public static class JavascriptTranslator.DefaultTypeTranslator
      extends Translator.ScriptTranslator.AbstractTypeTranslator

  Performs standard type translation for the TinkerPop types to Javascript.

- - ### Field Summary

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.Translator.ScriptTranslator.AbstractTypeTranslator

      `ANONYMOUS_TRAVERSAL_PREFIX, script, withParameters`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultTypeTranslator(boolean withParameters)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `getNullSyntax()` Gets the syntax for a `null` value as a string representation.
    `protected String` | `getSyntax(Boolean o)` Take the boolean argument and convert it to a string representation in the target language.
    `protected String` | `getSyntax(Date o)` Take the `Date` argument and convert it to a string representation in the target language.
    `protected String` | `getSyntax(Lambda o)` Take the `Lambda` argument and convert it to a string representation in the target language.
    `protected String` | `getSyntax(Number o)` Take the numeric argument and convert it to a string representation in the target language.
    `protected String` | `getSyntax(SackFunctions.Barrier o)` Take the `SackFunctions.Barrier` argument and convert it to a string representation in the target language.
    `protected String` | `getSyntax(String o)` Take the string argument and convert it to a string representation in the target language (i.e.
    `protected String` | `getSyntax(Timestamp o)` Take the `Timestamp` argument and convert it to a string representation in the target language.
    `protected String` | `getSyntax(TraversalOptionParent.Pick o)` Take the `TraversalOptionParent.Pick` argument and convert it to a string representation in the target language.
    `protected String` | `getSyntax(UUID o)` Take the `UUID` argument and convert it to a string representation in the target language.
    `protected String` | `getSyntax(VertexProperty.Cardinality o)` Take the `VertexProperty.Cardinality` argument and convert it to a string representation in the target language.
    `protected Script` | `produceScript(Class<?> o)` Take the `Class` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected Script` | `produceScript(Edge o)` Take the `Edge` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected Script` | `produceScript(Enum<?> o)` Take the `Enum` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected Script` | `produceScript(List<?> o)` Take the `List` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected Script` | `produceScript(Map<?,?> o)` Take the `Map` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected Script` | `produceScript(P<?> p)` Take the `P` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected Script` | `produceScript(Set<?> o)` Take the `Set` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected Script` | `produceScript(String traversalSource, Bytecode o)` Take the `Bytecode` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected Script` | `produceScript(TraversalStrategyProxy<?> o)` Take the `TraversalStrategyProxy` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected Script` | `produceScript(Vertex o)` Take the `Vertex` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected Script` | `produceScript(VertexProperty<?> o)` Take the `VertexProperty` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
    `protected String` | `resolveSymbol(String methodName)`

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.Translator.ScriptTranslator.AbstractTypeTranslator

      `apply, convertToScript, getAnonymousTraversalPrefix`

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

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

    - ### Methods inherited from interface java.util.function.BiFunction

      `andThen`

- - ### Constructor Detail

    - #### DefaultTypeTranslator

          public DefaultTypeTranslator(boolean withParameters)

  - ### Method Detail

    - #### getNullSyntax

          protected String getNullSyntax()

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Gets the syntax for a `null` value as a string representation.
      Specified by:
        `getNullSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### getSyntax

          protected String getSyntax(String o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the string argument and convert it to a string representation in the target language (i.e. escape, enclose in appropriate quotes, etc.)
      Specified by:
        `getSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### getSyntax

          protected String getSyntax(Boolean o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the boolean argument and convert it to a string representation in the target language.
      Specified by:
        `getSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### getSyntax

          protected String getSyntax(Date o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Date` argument and convert it to a string representation in the target language.
      Specified by:
        `getSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### getSyntax

          protected String getSyntax(Timestamp o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Timestamp` argument and convert it to a string representation in the target language.
      Specified by:
        `getSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### getSyntax

          protected String getSyntax(UUID o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `UUID` argument and convert it to a string representation in the target language.
      Specified by:
        `getSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### getSyntax

          protected String getSyntax(Lambda o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Lambda` argument and convert it to a string representation in the target language.
      Specified by:
        `getSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### getSyntax

          protected String getSyntax(SackFunctions.Barrier o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `SackFunctions.Barrier` argument and convert it to a string representation in the target language.
      Specified by:
        `getSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### getSyntax

          protected String getSyntax(VertexProperty.Cardinality o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `VertexProperty.Cardinality` argument and convert it to a string representation in the target language.
      Specified by:
        `getSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### getSyntax

          protected String getSyntax(TraversalOptionParent.Pick o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `TraversalOptionParent.Pick` argument and convert it to a string representation in the target language.
      Specified by:
        `getSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### getSyntax

          protected String getSyntax(Number o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the numeric argument and convert it to a string representation in the target language. Languages that can discern differences in types of numbers will wish to further check the type of the `Number` instance itself (i.e. `Double`, `Integer`, etc.)
      Specified by:
        `getSyntax` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(Set<?> o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Set` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(List<?> o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `List` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(Map<?,?> o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Map` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(Class<?> o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Class` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(Enum<?> o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Enum` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(Vertex o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Vertex` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(Edge o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Edge` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(VertexProperty<?> o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `VertexProperty` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(TraversalStrategyProxy<?> o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `TraversalStrategyProxy` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(String traversalSource,
                                         Bytecode o)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `Bytecode` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### produceScript

          protected Script produceScript(P<?> p)

      Description copied from class: `Translator.ScriptTranslator.AbstractTypeTranslator`
      Take the `P` and writes the syntax directly to the member `Translator.ScriptTranslator.AbstractTypeTranslator.script` variable. This implementation should also consider `TextP`.
      Specified by:
        `produceScript` in class `Translator.ScriptTranslator.AbstractTypeTranslator`

    - #### resolveSymbol

          protected String resolveSymbol(String methodName)

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