Search in sources :

Example 31 with Types

use of javax.lang.model.util.Types in project neo4j by neo4j.

the class AllowedTypesValidatorTest method prepare.

@Before
public void prepare() {
    Types types = compilation.getTypes();
    Elements elements = compilation.getElements();
    TypeMirrorUtils typeMirrors = new TypeMirrorUtils(types, elements);
    typeMirrorTestUtils = new TypeMirrorTestUtils(compilation);
    validator = new AllowedTypesValidator(typeMirrors, types);
}
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)

Example 32 with Types

use of javax.lang.model.util.Types in project neo4j by neo4j.

the class UserFunctionVisitorTest method prepare.

@Before
public void prepare() {
    Types types = compilationRule.getTypes();
    Elements elements = compilationRule.getElements();
    elementTestUtils = new ElementTestUtils(compilationRule);
    visitor = new UserFunctionVisitor(types, elements, new TypeMirrorUtils(types, elements));
}
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 33 with Types

use of javax.lang.model.util.Types in project intellij-community by JetBrains.

the class Javac8RefScanner method visitLambdaExpression.

@Override
public Tree visitLambdaExpression(LambdaExpressionTree node, JavacReferenceCollectorListener.ReferenceCollector refCollector) {
    final TypeMirror type = refCollector.getType(node);
    Types types = refCollector.getTypeUtility();
    if (types != null) {
        final Element element = types.asElement(type);
        if (element != null) {
            final JavacRef.JavacElementRefBase ref = refCollector.asJavacRef(element);
            if (ref != null) {
                refCollector.sinkDeclaration(new JavacDef.JavacFunExprDef(ref));
            }
        }
    }
    return super.visitLambdaExpression(node, refCollector);
}
Also used : JavacDef(org.jetbrains.jps.javac.ast.api.JavacDef) Types(javax.lang.model.util.Types) TypeMirror(javax.lang.model.type.TypeMirror) JavacRef(org.jetbrains.jps.javac.ast.api.JavacRef) Element(javax.lang.model.element.Element)

Aggregations

Types (javax.lang.model.util.Types)33 TypeMirror (javax.lang.model.type.TypeMirror)21 Elements (javax.lang.model.util.Elements)16 TypeElement (javax.lang.model.element.TypeElement)14 ExecutableElement (javax.lang.model.element.ExecutableElement)9 Element (javax.lang.model.element.Element)7 Test (org.junit.Test)7 DeclaredType (javax.lang.model.type.DeclaredType)6 LinkedHashMap (java.util.LinkedHashMap)5 Map (java.util.Map)5 Set (java.util.Set)5 LinkedHashSet (java.util.LinkedHashSet)4 List (java.util.List)4 Optional (java.util.Optional)4 VariableElement (javax.lang.model.element.VariableElement)4 TypeMirrorUtils (org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 SupportedAnnotationTypes (javax.annotation.processing.SupportedAnnotationTypes)3 Before (org.junit.Before)3