public abstract static class Translator.ScriptTranslator.AbstractTypeTranslator extends Object implements Translator.ScriptTranslator.TypeTranslator
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ANONYMOUS_TRAVERSAL_PREFIX |
protected Script |
script |
protected boolean |
withParameters |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTypeTranslator(boolean withParameters) |
| Modifier and Type | Method and Description |
|---|---|
Script |
apply(String traversalSource,
Object o) |
protected Script |
convertToScript(Object object)
For each operator argument, if withParameters set true, try parametrization as follows:
-----------------------------------------------
if unpack, why ? ObjectType
-----------------------------------------------
(Yes) Bytecode.Binding
(Recursion, No) Bytecode
(Recursion, No) Traversal
(Yes) String
(Recursion, No) Set
(Recursion, No) List
(Recursion, No) Map
(Yes) Long
(Yes) Double
(Yes) Float
(Yes) Integer
(Yes) Timestamp
(Yes) Date
(Yes) Uuid
(Recursion, No) P
(Enumeration, No) SackFunctions.Barrier
(Enumeration, No) VertexProperty.Cardinality
(Enumeration, No) TraversalOptionParent.Pick
(Enumeration, No) Enum
(Recursion, No) Vertex
(Recursion, No) Edge
(Recursion, No) VertexProperty
(Yes) Lambda
(Recursion, No) TraversalStrategyProxy
(Enumeration, No) TraversalStrategy
(Yes) Other
-------------------------------------------------
|
protected String |
getAnonymousTraversalPrefix()
Gets the syntax for the spawn of an anonymous traversal which is traditionally the double underscore.
|
protected abstract String |
getNullSyntax()
Gets the syntax for a
null value as a string representation. |
protected abstract String |
getSyntax(Boolean o)
Take the boolean argument and convert it to a string representation in the target language.
|
protected abstract String |
getSyntax(Date o)
Take the
Date argument and convert it to a string representation in the target language. |
protected abstract String |
getSyntax(org.apache.tinkerpop.gremlin.util.function.Lambda o)
Take the
Lambda argument and convert it to a string representation in the target language. |
protected abstract String |
getSyntax(Number o)
Take the numeric argument and convert it to a string representation in the target language.
|
protected abstract String |
getSyntax(SackFunctions.Barrier o)
Take the
SackFunctions.Barrier argument and convert it to a string representation in the target language. |
protected abstract String |
getSyntax(String o)
Take the string argument and convert it to a string representation in the target language (i.e.
|
protected abstract String |
getSyntax(Timestamp o)
Take the
Timestamp argument and convert it to a string representation in the target language. |
protected abstract String |
getSyntax(org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent.Pick o)
Take the
TraversalOptionParent.Pick argument and convert it to a string representation in the target language. |
protected abstract String |
getSyntax(UUID o)
Take the
UUID argument and convert it to a string representation in the target language. |
protected abstract String |
getSyntax(VertexProperty.Cardinality o)
Take the
VertexProperty.Cardinality argument and convert it to a string representation in the target language. |
protected abstract Script |
produceScript(Class<?> o)
Take the
Class and writes the syntax directly to the member script variable. |
protected abstract Script |
produceScript(Edge o)
|
protected abstract Script |
produceScript(Enum<?> o)
Take the
Enum and writes the syntax directly to the member script variable. |
protected abstract Script |
produceScript(List<?> o)
Take the
List and writes the syntax directly to the member script variable. |
protected abstract Script |
produceScript(Map<?,?> o)
Take the
Map and writes the syntax directly to the member script variable. |
protected abstract Script |
produceScript(P<?> p)
|
protected abstract Script |
produceScript(Set<?> o)
Take the
Set and writes the syntax directly to the member script variable. |
protected abstract Script |
produceScript(String traversalSource,
Bytecode o)
|
protected abstract Script |
produceScript(org.apache.tinkerpop.gremlin.process.traversal.strategy.TraversalStrategyProxy<?> o)
Take the
TraversalStrategyProxy and writes the syntax directly to the member script variable. |
protected abstract Script |
produceScript(Vertex o)
|
protected abstract Script |
produceScript(VertexProperty<?> o)
Take the
VertexProperty and writes the syntax directly to the member script variable. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitandThenprotected static final String ANONYMOUS_TRAVERSAL_PREFIX
protected final boolean withParameters
protected final Script script
public Script apply(String traversalSource, Object o)
apply in interface BiFunction<String,Object,Script>protected String getAnonymousTraversalPrefix()
protected abstract String getNullSyntax()
null value as a string representation.protected abstract String getSyntax(String o)
protected abstract String getSyntax(Boolean o)
protected abstract String getSyntax(Date o)
Date argument and convert it to a string representation in the target language.protected abstract String getSyntax(Timestamp o)
Timestamp argument and convert it to a string representation in the target language.protected abstract String getSyntax(UUID o)
UUID argument and convert it to a string representation in the target language.protected abstract String getSyntax(org.apache.tinkerpop.gremlin.util.function.Lambda o)
Lambda argument and convert it to a string representation in the target language.protected abstract String getSyntax(SackFunctions.Barrier o)
SackFunctions.Barrier argument and convert it to a string representation in the target language.protected abstract String getSyntax(VertexProperty.Cardinality o)
VertexProperty.Cardinality argument and convert it to a string representation in the target language.protected abstract String getSyntax(org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent.Pick o)
TraversalOptionParent.Pick argument and convert it to a string representation in the target language.protected abstract String getSyntax(Number o)
Number instance itself (i.e. Double, Integer, etc.)protected abstract Script produceScript(Set<?> o)
Set and writes the syntax directly to the member script variable.protected abstract Script produceScript(List<?> o)
List and writes the syntax directly to the member script variable.protected abstract Script produceScript(Map<?,?> o)
Map and writes the syntax directly to the member script variable.protected abstract Script produceScript(Class<?> o)
Class and writes the syntax directly to the member script variable.protected abstract Script produceScript(Enum<?> o)
Enum and writes the syntax directly to the member script variable.protected abstract Script produceScript(VertexProperty<?> o)
VertexProperty and writes the syntax directly to the member script variable.protected abstract Script produceScript(org.apache.tinkerpop.gremlin.process.traversal.strategy.TraversalStrategyProxy<?> o)
TraversalStrategyProxy and writes the syntax directly to the member script variable.protected Script convertToScript(Object object)
object - Copyright © 2013–2022 Apache Software Foundation. All rights reserved.