本文整理匯總了Java中org.apache.tinkerpop.gremlin.jsr223.JavaTranslator類的典型用法代碼示例。如果您正苦於以下問題:Java JavaTranslator類的具體用法?Java JavaTranslator怎麽用?Java JavaTranslator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JavaTranslator類屬於org.apache.tinkerpop.gremlin.jsr223包,在下文中一共展示了JavaTranslator類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: traversal
import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; //導入依賴的package包/類
@Override
public GraphTraversalSource traversal(final Graph graph) {
if ((Boolean) graph.configuration().getProperty("skipTest"))
return graph.traversal();
//throw new VerificationException("This test current does not work with Gremlin-Python", EmptyTraversal.instance());
else {
try {
ScriptEngineCache.get("jython").eval(IMPORT_STATICS ?
"statics.load_statics(globals())" :
"statics.unload_statics(globals())");
} catch (final ScriptException e) {
throw new IllegalStateException(e.getMessage(), e);
}
final GraphTraversalSource g = graph.traversal();
return g.withStrategies(new TranslationStrategy(g,
new PythonGraphSONJavaTranslator<>(
PythonTranslator.of("g", IMPORT_STATICS),
JavaTranslator.of(g),
RANDOM.nextBoolean() ? GraphSONVersion.V2_0 : GraphSONVersion.V3_0)));
}
}
示例2: traversal
import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; //導入依賴的package包/類
@Override
public GraphTraversalSource traversal(final Graph graph) {
if ((Boolean) graph.configuration().getProperty("skipTest"))
return graph.traversal();
//throw new VerificationException("This test current does not work with Gremlin-Python", EmptyTraversal.instance());
else {
final GraphTraversalSource g = graph.traversal();
return g.withStrategies(new TranslationStrategy(g, new GryoTranslator<>(JavaTranslator.of(g))));
}
}
開發者ID:ShiftLeftSecurity,項目名稱:tinkergraph-gremlin,代碼行數:11,代碼來源:TinkerGraphGryoTranslatorProvider.java
示例3: traversal
import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; //導入依賴的package包/類
@Override
public GraphTraversalSource traversal(final Graph graph) {
if ((Boolean) graph.configuration().getProperty("skipTest"))
return graph.traversal();
//throw new VerificationException("This test current does not work with Gremlin-Python", EmptyTraversal.instance());
else {
final GraphTraversalSource g = graph.traversal();
return g.withStrategies(new TranslationStrategy(g, new GraphSONTranslator<>(JavaTranslator.of(g))));
}
}
開發者ID:ShiftLeftSecurity,項目名稱:tinkergraph-gremlin,代碼行數:11,代碼來源:TinkerGraphGraphSONTranslatorProvider.java
示例4: PythonGraphSONJavaTranslator
import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; //導入依賴的package包/類
public PythonGraphSONJavaTranslator(final PythonTranslator pythonTranslator, final JavaTranslator<S, T> javaTranslator, final GraphSONVersion version) {
this.pythonTranslator = pythonTranslator;
this.javaTranslator = javaTranslator;
this.version = version;
this.reader = GraphSONReader.build().mapper(
GraphSONMapper.build().addCustomModule(version.equals(GraphSONVersion.V2_0) ?
GraphSONXModuleV2d0.build().create(false) :
GraphSONXModuleV3d0.build().create(false))
.version(version).create()).create();
this.writer = GraphSONWriter.build().mapper(
GraphSONMapper.build().addCustomModule(version.equals(GraphSONVersion.V2_0) ?
GraphSONXModuleV2d0.build().create(false) :
GraphSONXModuleV3d0.build().create(false))
.version(version).create()).create();
}
示例5: GryoTranslator
import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; //導入依賴的package包/類
public GryoTranslator(final JavaTranslator<S, T> wrappedTranslator) {
this.wrappedTranslator = wrappedTranslator;
}
示例6: GraphSONTranslator
import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; //導入依賴的package包/類
public GraphSONTranslator(final JavaTranslator<S, T> wrappedTranslator) {
this.wrappedTranslator = wrappedTranslator;
}
示例7: submit
import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; //導入依賴的package包/類
@Override
public <E> RemoteTraversal<?, E> submit(final Bytecode bytecode) throws RemoteConnectionException {
// this method is technically deprecated but it's still being used on the 3.2.x/3.3.x lines of code. it is
// called by submitAsync() in RemoteConnection itself. this implementation should suffice for now
return new EmbeddedRemoteTraversal(JavaTranslator.of(g).translate(bytecode));
}