当前位置: 首页>>代码示例>>Java>>正文


Java JavaTranslator类代码示例

本文整理汇总了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)));
    }
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:22,代码来源:PythonProvider.java

示例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();
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:16,代码来源:PythonGraphSONJavaTranslator.java

示例5: GryoTranslator

import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; //导入依赖的package包/类
public GryoTranslator(final JavaTranslator<S, T> wrappedTranslator) {
    this.wrappedTranslator = wrappedTranslator;
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:4,代码来源:GryoTranslator.java

示例6: GraphSONTranslator

import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; //导入依赖的package包/类
public GraphSONTranslator(final JavaTranslator<S, T> wrappedTranslator) {
    this.wrappedTranslator = wrappedTranslator;
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:4,代码来源:GraphSONTranslator.java

示例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));
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:7,代码来源:EmbeddedRemoteConnection.java


注:本文中的org.apache.tinkerpop.gremlin.jsr223.JavaTranslator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。