Interface Translator<S,T>
-
- All Known Subinterfaces:
Translator.ScriptTranslator,Translator.StepTranslator<S,T>
- All Known Implementing Classes:
DotNetTranslator,GolangTranslator,GroovyTranslator,JavascriptTranslator,JavaTranslator,PythonTranslator
public interface Translator<S,T>A Translator will translateBytecodeinto another representation. That representation may be a Java instance viaTranslator.StepTranslatoror a String script in some language viaTranslator.ScriptTranslator. The parameterization of Translator is S (traversal source) and T (full translation).- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Stark Arya (sandszhou.zj@alibaba-inc.com), Stephen Mallette (http://stephen.genoprime.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceTranslator.ScriptTranslatorTranslates bytecode to a Script representation.static interfaceTranslator.StepTranslator<S extends TraversalSource,T extends Traversal.Admin<?,?>>Translates bytecode to actual steps.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringgetTargetLanguage()Get the language that the translator is converting the traversal byte code to.SgetTraversalSource()Get theTraversalSourcerepresentation rooting this translator.Ttranslate(Bytecode bytecode)TranslateBytecodeinto a new representation.default Ttranslate(Traversal<?,?> t)Translates aTraversalinto the specified form
-
-
-
Method Detail
-
getTraversalSource
S getTraversalSource()
Get theTraversalSourcerepresentation rooting this translator. For string-based translators (Translator.ScriptTranslator), this is typically a "g". For java-based translators (Translator.StepTranslator), this is typically theTraversalSourceinstance which theTraversalwill be built from.- Returns:
- the traversal source representation
-
translate
T translate(Bytecode bytecode)
TranslateBytecodeinto a new representation. Typically, for language translations, the translation is to a string representing the traversal in the respective scripting language.- Parameters:
bytecode- the bytecode representing traversal source and traversal manipulations.- Returns:
- the translated object
-
getTargetLanguage
String getTargetLanguage()
Get the language that the translator is converting the traversal byte code to.- Returns:
- the language of the translation
-
-