本文整理汇总了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));
}