Search in sources :

Example 1 with TypeMirrorUtils

use of org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils in project neo4j by neo4j.

the class RecordFieldTypeVisitorTest method prepare.

@Before
public void prepare() {
    Elements elements = compilationRule.getElements();
    types = compilationRule.getTypes();
    typeMirrorUtils = new TypeMirrorUtils(types, elements);
    typeMirrorTestUtils = new TypeMirrorTestUtils(compilationRule);
}
Also used : TypeMirrorTestUtils(org.neo4j.tooling.procedure.testutils.TypeMirrorTestUtils) Elements(javax.lang.model.util.Elements) TypeMirrorUtils(org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils) Before(org.junit.Before)

Example 2 with TypeMirrorUtils

use of org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils in project neo4j by neo4j.

the class UserAggregationFunctionVisitorTest method prepare.

@Before
public void prepare() {
    Types types = compilationRule.getTypes();
    Elements elements = compilationRule.getElements();
    elementTestUtils = new ElementTestUtils(compilationRule);
    final TypeMirrorUtils typeMirrorUtils = new TypeMirrorUtils(types, elements);
    visitor = new UserAggregationFunctionVisitor(new FunctionVisitor<>(UserAggregationFunction.class, types, elements, typeMirrorUtils, function -> CustomNameExtractor.getName(function::name, function::value), false), types);
}
Also used : Types(javax.lang.model.util.Types) Elements(javax.lang.model.util.Elements) TypeMirrorUtils(org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils) ElementTestUtils(org.neo4j.tooling.procedure.testutils.ElementTestUtils) Before(org.junit.Before)

Example 3 with TypeMirrorUtils

use of org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils in project neo4j by neo4j.

the class UserFunctionProcessor method init.

@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    Types typeUtils = processingEnv.getTypeUtils();
    Elements elementUtils = processingEnv.getElementUtils();
    visitedFunctions.clear();
    messagePrinter = new MessagePrinter(processingEnv.getMessager());
    visitor = new UserFunctionVisitor(typeUtils, elementUtils, new TypeMirrorUtils(typeUtils, elementUtils));
    duplicationPredicate = new DuplicatedProcedureValidator<>(elementUtils, userFunctionType, UserFunctionProcessor::getCustomName);
}
Also used : Types(javax.lang.model.util.Types) UserFunctionVisitor(org.neo4j.tooling.procedure.visitors.UserFunctionVisitor) MessagePrinter(org.neo4j.tooling.procedure.messages.MessagePrinter) Elements(javax.lang.model.util.Elements) TypeMirrorUtils(org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils)

Example 4 with TypeMirrorUtils

use of org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils in project neo4j by neo4j.

the class ParameterTypeVisitorTest method prepare.

@Before
public void prepare() {
    Elements elements = compilationRule.getElements();
    types = compilationRule.getTypes();
    typeMirrorUtils = new TypeMirrorUtils(types, elements);
    typeMirrorTestUtils = new TypeMirrorTestUtils(compilationRule);
}
Also used : TypeMirrorTestUtils(org.neo4j.tooling.procedure.testutils.TypeMirrorTestUtils) Elements(javax.lang.model.util.Elements) TypeMirrorUtils(org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils) Before(org.junit.Before)

Example 5 with TypeMirrorUtils

use of org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils in project neo4j by neo4j.

the class RecordTypeVisitorTest method prepare.

@Before
public void prepare() {
    Types types = compilation.getTypes();
    Elements elements = compilation.getElements();
    TypeMirrorUtils typeMirrors = new TypeMirrorUtils(types, elements);
    typeMirrorTestUtils = new TypeMirrorTestUtils(compilation);
    visitor = new RecordTypeVisitor(types, typeMirrors);
}
Also used : Types(javax.lang.model.util.Types) TypeMirrorTestUtils(org.neo4j.tooling.procedure.testutils.TypeMirrorTestUtils) Elements(javax.lang.model.util.Elements) TypeMirrorUtils(org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils) Before(org.junit.Before)

Aggregations

Elements (javax.lang.model.util.Elements)7 TypeMirrorUtils (org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils)7 Before (org.junit.Before)6 Types (javax.lang.model.util.Types)5 TypeMirrorTestUtils (org.neo4j.tooling.procedure.testutils.TypeMirrorTestUtils)4 ElementTestUtils (org.neo4j.tooling.procedure.testutils.ElementTestUtils)2 MessagePrinter (org.neo4j.tooling.procedure.messages.MessagePrinter)1 UserFunctionVisitor (org.neo4j.tooling.procedure.visitors.UserFunctionVisitor)1