Class DotNetTranslator
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.translator.DotNetTranslator
-
- All Implemented Interfaces:
Translator<String,Script>
,Translator.ScriptTranslator
public final class DotNetTranslator extends Object implements Translator.ScriptTranslator
Converts bytecode to a C# string of Gremlin.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DotNetTranslator.DefaultTypeTranslator
Performs standard type translation for the TinkerPop types to C#.-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Translator
Translator.ScriptTranslator, Translator.StepTranslator<S extends TraversalSource,T extends Traversal.Admin<?,?>>
-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Translator.ScriptTranslator
Translator.ScriptTranslator.AbstractTypeTranslator, Translator.ScriptTranslator.TypeTranslator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getTargetLanguage()
Get the language that the translator is converting the traversal byte code to.String
getTraversalSource()
Get theTraversalSource
representation rooting this translator.static DotNetTranslator
of(String traversalSource)
static DotNetTranslator
of(String traversalSource, boolean withParameters)
Creates the translator with theDotNetTranslator.DefaultTypeTranslator
passing thewithParameters
option to it which will handle type translation in a fashion that should typically increase cache hits and reduce compilation times if enabled at the sacrifice to rewriting of the script that could reduce readability.static DotNetTranslator
of(String traversalSource, Translator.ScriptTranslator.TypeTranslator typeTranslator)
Creates the translator with a customTranslator.ScriptTranslator.TypeTranslator
instance.String
toString()
Script
translate(Bytecode bytecode)
TranslateBytecode
into a new representation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Translator
translate
-
-
-
-
Method Detail
-
of
public static DotNetTranslator of(String traversalSource)
-
of
public static DotNetTranslator of(String traversalSource, boolean withParameters)
Creates the translator with theDotNetTranslator.DefaultTypeTranslator
passing thewithParameters
option to it which will handle type translation in a fashion that should typically increase cache hits and reduce compilation times if enabled at the sacrifice to rewriting of the script that could reduce readability.
-
of
public static DotNetTranslator of(String traversalSource, Translator.ScriptTranslator.TypeTranslator typeTranslator)
Creates the translator with a customTranslator.ScriptTranslator.TypeTranslator
instance.
-
translate
public Script translate(Bytecode bytecode)
Description copied from interface:Translator
TranslateBytecode
into a new representation. Typically, for language translations, the translation is to a string representing the traversal in the respective scripting language.- Specified by:
translate
in interfaceTranslator<String,Script>
- Parameters:
bytecode
- the bytecode 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 interfaceTranslator<String,Script>
- Returns:
- the language of the translation
-
getTraversalSource
public String getTraversalSource()
Description copied from interface:Translator
Get theTraversalSource
representation rooting this translator. For string-based translators (Translator.ScriptTranslator
), this is typically a "g". For java-based translators (Translator.StepTranslator
), this is typically theTraversalSource
instance which theTraversal
will be built from.- Specified by:
getTraversalSource
in interfaceTranslator<String,Script>
- Returns:
- the traversal source representation
-
-