當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。