Search in sources :

Example 1 with CompilerCustomizerProvider

use of org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider in project atlas by apache.

the class AtlasJanusGraph method getGremlinScriptEngine.

@Override
public GremlinGroovyScriptEngine getGremlinScriptEngine() {
    Set<String> extraImports = new HashSet<String>();
    extraImports.add(java.util.function.Function.class.getName());
    Set<String> extraStaticImports = new HashSet<String>();
    extraStaticImports.add(P.class.getName() + ".*");
    extraStaticImports.add(__.class.getName() + ".*");
    CompilerCustomizerProvider provider = new DefaultImportCustomizerProvider(extraImports, extraStaticImports);
    GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(provider);
    return scriptEngine;
}
Also used : Function(com.google.common.base.Function) CompilerCustomizerProvider(org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider) GremlinGroovyScriptEngine(org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine) HashSet(java.util.HashSet) DefaultImportCustomizerProvider(org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider)

Example 2 with CompilerCustomizerProvider

use of org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider in project incubator-atlas by apache.

the class Titan1Graph method getGremlinScriptEngine.

@Override
public GremlinGroovyScriptEngine getGremlinScriptEngine() {
    Set<String> extraImports = new HashSet<String>();
    extraImports.add(java.util.function.Function.class.getName());
    Set<String> extraStaticImports = new HashSet<String>();
    extraStaticImports.add(P.class.getName() + ".*");
    extraStaticImports.add(__.class.getName() + ".*");
    CompilerCustomizerProvider provider = new DefaultImportCustomizerProvider(extraImports, extraStaticImports);
    GremlinGroovyScriptEngine scriptEngine = new GremlinGroovyScriptEngine(provider);
    return scriptEngine;
}
Also used : Function(com.google.common.base.Function) CompilerCustomizerProvider(org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider) GremlinGroovyScriptEngine(org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine) HashSet(java.util.HashSet) DefaultImportCustomizerProvider(org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider)

Aggregations

Function (com.google.common.base.Function)2 HashSet (java.util.HashSet)2 CompilerCustomizerProvider (org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider)2 DefaultImportCustomizerProvider (org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider)2 GremlinGroovyScriptEngine (org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine)2