Search in sources :

Example 41 with ClassOrInterfaceType

use of com.github.javaparser.ast.type.ClassOrInterfaceType in project javaparser by javaparser.

the class JavaParserTest method parseIntersectionType.

@Test
public void parseIntersectionType() {
    String code = "(Runnable & Serializable) (() -> {})";
    Expression expression = JavaParser.parseExpression(code);
    Type type = expression.asCastExpr().getType();
    assertTrue(type instanceof IntersectionType);
    IntersectionType intersectionType = type.asIntersectionType();
    assertEquals(2, intersectionType.getElements().size());
    assertTrue(intersectionType.getElements().get(0) instanceof ClassOrInterfaceType);
    assertEquals("Runnable", intersectionType.getElements().get(0).asClassOrInterfaceType().getNameAsString());
    assertTrue(intersectionType.getElements().get(1) instanceof ClassOrInterfaceType);
    assertEquals("Serializable", intersectionType.getElements().get(1).asClassOrInterfaceType().getNameAsString());
}
Also used : ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) IntersectionType(com.github.javaparser.ast.type.IntersectionType) Type(com.github.javaparser.ast.type.Type) IntersectionType(com.github.javaparser.ast.type.IntersectionType) Expression(com.github.javaparser.ast.expr.Expression) ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) Test(org.junit.Test)

Example 42 with ClassOrInterfaceType

use of com.github.javaparser.ast.type.ClassOrInterfaceType in project javaparser by javaparser.

the class Java7ValidatorTest method multiCatchWithOneElement.

@Test
public void multiCatchWithOneElement() {
    UnionType unionType = new UnionType();
    unionType.getElements().add(new ClassOrInterfaceType());
    List<Problem> problems = new ArrayList<>();
    new Java7Validator().accept(unionType, new ProblemReporter(problems::add));
    assertProblems(problems, "Union type (multi catch) must have at least two elements.");
}
Also used : UnionType(com.github.javaparser.ast.type.UnionType) Problem(com.github.javaparser.Problem) ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) Test(org.junit.Test)

Example 43 with ClassOrInterfaceType

use of com.github.javaparser.ast.type.ClassOrInterfaceType in project javaparser by javaparser.

the class ModuleDeclarationTest method jlsExample1.

@Test
public void jlsExample1() {
    CompilationUnit cu = parse("@Foo(1) @Foo(2) @Bar " + "module M.N {" + "  requires A.B;" + "  requires transitive C.D;" + "  requires static E.F;" + "  requires transitive static G.H;" + "" + "  exports P.Q;" + "  exports R.S to T1.U1, T2.U2;" + "" + "  opens P.Q;" + "  opens R.S to T1.U1, T2.U2;" + "" + "  uses V.W;" + "  provides X.Y with Z1.Z2, Z3.Z4;" + "}");
    ModuleDeclaration module = cu.getModule().get();
    assertEquals("M.N", module.getNameAsString());
    assertEquals(false, module.isOpen());
    assertThat(module.getAnnotations()).containsExactly(new SingleMemberAnnotationExpr(new Name("Foo"), new IntegerLiteralExpr("1")), new SingleMemberAnnotationExpr(new Name("Foo"), new IntegerLiteralExpr("2")), new MarkerAnnotationExpr(new Name("Bar")));
    ModuleRequiresStmt moduleRequiresStmt = module.getModuleStmts().get(0).asModuleRequiresStmt();
    assertThat(moduleRequiresStmt.getNameAsString()).isEqualTo("A.B");
    assertThat(moduleRequiresStmt.getModifiers()).isEmpty();
    ModuleExportsStmt moduleExportsStmt = module.getModuleStmts().get(5).asModuleExportsStmt();
    assertThat(moduleExportsStmt.getNameAsString()).isEqualTo("R.S");
    assertThat(moduleExportsStmt.getModuleNames()).containsExactly(parseName("T1.U1"), parseName("T2.U2"));
    ModuleOpensStmt moduleOpensStmt = module.getModuleStmts().get(7).asModuleOpensStmt();
    assertThat(moduleOpensStmt.getNameAsString()).isEqualTo("R.S");
    assertThat(moduleOpensStmt.getModuleNames()).containsExactly(parseName("T1.U1"), parseName("T2.U2"));
    ModuleUsesStmt moduleUsesStmt = module.getModuleStmts().get(8).asModuleUsesStmt();
    assertThat(moduleUsesStmt.getType().toString()).isEqualTo("V.W");
    ModuleProvidesStmt moduleProvidesStmt = module.getModuleStmts().get(9).asModuleProvidesStmt();
    assertThat(moduleProvidesStmt.getType().toString()).isEqualTo("X.Y");
    assertThat(moduleProvidesStmt.getWithTypes()).containsExactly(new ClassOrInterfaceType(parseClassOrInterfaceType("Z1"), "Z2"), new ClassOrInterfaceType(parseClassOrInterfaceType("Z3"), "Z4"));
}
Also used : CompilationUnit(com.github.javaparser.ast.CompilationUnit) SingleMemberAnnotationExpr(com.github.javaparser.ast.expr.SingleMemberAnnotationExpr) IntegerLiteralExpr(com.github.javaparser.ast.expr.IntegerLiteralExpr) MarkerAnnotationExpr(com.github.javaparser.ast.expr.MarkerAnnotationExpr) ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) JavaParser.parseClassOrInterfaceType(com.github.javaparser.JavaParser.parseClassOrInterfaceType) Name(com.github.javaparser.ast.expr.Name) JavaParser.parseName(com.github.javaparser.JavaParser.parseName) Test(org.junit.Test)

Example 44 with ClassOrInterfaceType

use of com.github.javaparser.ast.type.ClassOrInterfaceType in project javaparser by javaparser.

the class NodeWithMembersBuildersTest method testGetMethodsWithParameterTypes.

@Test
public void testGetMethodsWithParameterTypes() {
    classDeclaration.addMethod("foo", Modifier.PUBLIC);
    MethodDeclaration addMethod2 = classDeclaration.addMethod("foo", Modifier.PUBLIC).addParameter(int.class, "overload");
    ClassOrInterfaceType type = parseClassOrInterfaceType("List");
    type.setTypeArguments(parseClassOrInterfaceType("String"));
    MethodDeclaration methodWithListParam = classDeclaration.addMethod("fooList", Modifier.PUBLIC).addParameter(type, "overload");
    MethodDeclaration addMethod3 = classDeclaration.addMethod("foo2", Modifier.PUBLIC).addParameter(int.class, "overload");
    List<MethodDeclaration> methodsByParam = classDeclaration.getMethodsByParameterTypes(int.class);
    assertEquals(2, methodsByParam.size());
    assertTrue(methodsByParam.contains(addMethod2));
    assertTrue(methodsByParam.contains(addMethod3));
    List<MethodDeclaration> methodsByParam2 = classDeclaration.getMethodsByParameterTypes("List<String>");
    assertEquals(1, methodsByParam2.size());
    assertTrue(methodsByParam2.contains(methodWithListParam));
}
Also used : ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) JavaParser.parseClassOrInterfaceType(com.github.javaparser.JavaParser.parseClassOrInterfaceType) Test(org.junit.Test)

Example 45 with ClassOrInterfaceType

use of com.github.javaparser.ast.type.ClassOrInterfaceType in project drools by kiegroup.

the class ExpressionTyper method drlNameExpr.

private Optional<TypedExpressionCursor> drlNameExpr(Expression drlxExpr, DrlNameExpr firstNode, boolean isInLineCast, java.lang.reflect.Type originalTypeCursor) {
    String firstName = firstNode.getName().getIdentifier();
    java.lang.reflect.Type typeCursor;
    // In OOPath a declaration is based on a position rather than a name.
    // Only an OOPath chunk can have a backreference expression
    Optional<DeclarationSpec> backReference = empty();
    if (firstNode.getBackReferencesCount() > 0) {
        List<DeclarationSpec> ooPathDeclarations = ruleContext.getOOPathDeclarations();
        DeclarationSpec backReferenceDeclaration = ooPathDeclarations.get(ooPathDeclarations.size() - 1 - firstNode.getBackReferencesCount());
        typeCursor = backReferenceDeclaration.getDeclarationClass();
        backReference = of(backReferenceDeclaration);
        context.addUsedDeclarations(backReferenceDeclaration.getBindingId());
    } else {
        typeCursor = originalTypeCursor;
    }
    try {
        Class<?> resolvedType = ruleContext.getTypeResolver().resolveType(firstName);
        return of(new TypedExpressionCursor(new NameExpr(firstName), resolvedType));
    } catch (ClassNotFoundException e) {
    // ignore
    }
    Class<?> classCursor = toRawClass(typeCursor);
    if (classCursor != null) {
        Method firstAccessor = DrlxParseUtil.getAccessor(!isInLineCast ? classCursor : patternType, firstName, ruleContext);
        if (firstAccessor != null) {
            if (!"".equals(firstName)) {
                context.addReactOnProperties(firstName);
            }
            NameExpr thisAccessor = new NameExpr(THIS_PLACEHOLDER);
            NameExpr scope = backReference.map(d -> new NameExpr(d.getBindingId())).orElse(thisAccessor);
            Expression fieldAccessor = new MethodCallExpr(scope, firstAccessor.getName());
            if (isInLineCast) {
                return of(new TypedExpressionCursor(fieldAccessor, typeCursor));
            }
            Optional<java.lang.reflect.Type> castType = ruleContext.explicitCastType(firstName).flatMap(t -> safeResolveType(ruleContext.getTypeResolver(), t.asString()));
            if (castType.isPresent()) {
                java.lang.reflect.Type typeOfFirstAccessor = castType.get();
                ClassOrInterfaceType typeWithoutDollar = toClassOrInterfaceType(typeOfFirstAccessor.getTypeName());
                return of(new TypedExpressionCursor(addCastToExpression(typeWithoutDollar, fieldAccessor, false), typeOfFirstAccessor));
            }
            return of(new TypedExpressionCursor(fieldAccessor, firstAccessor.getGenericReturnType()));
        }
        Field field = DrlxParseUtil.getField(classCursor, firstName);
        if (field != null) {
            NameExpr scope = new NameExpr(Modifier.isStatic(field.getModifiers()) ? classCursor.getCanonicalName() : THIS_PLACEHOLDER);
            return of(new TypedExpressionCursor(new FieldAccessExpr(scope, field.getName()), field.getType()));
        }
    }
    Optional<DeclarationSpec> declarationById = ruleContext.getDeclarationById(firstName);
    if (declarationById.isPresent()) {
        // do NOT append any reactOnProperties.
        // because reactOnProperties is referring only to the properties of the type of the pattern, not other declarations properites.
        context.addUsedDeclarations(firstName);
        typeCursor = isInLineCast ? originalTypeCursor : declarationById.get().getDeclarationClass();
        return of(new TypedExpressionCursor(new NameExpr(firstName), typeCursor));
    }
    if (packageModel.getGlobals().containsKey(firstName)) {
        context.addUsedDeclarations(firstName);
        return of(new TypedExpressionCursor(new NameExpr(firstName), packageModel.getGlobals().get(firstName)));
    }
    final Optional<Node> rootNode = findRootNodeViaParent(drlxExpr);
    rootNode.ifPresent(n -> {
        // In the error messages HalfBinary are transformed to Binary
        Node withHalfBinaryReplaced = replaceAllHalfBinaryChildren(n);
        ruleContext.addCompilationError(new ParseExpressionErrorResult((Expression) withHalfBinaryReplaced, ruleContext.getCurrentConstraintDescr()));
    });
    return empty();
}
Also used : ArrayAccessExpr(com.github.javaparser.ast.expr.ArrayAccessExpr) Arrays(java.util.Arrays) ClassExpr(com.github.javaparser.ast.expr.ClassExpr) HalfPointFreeExpr(org.drools.mvel.parser.ast.expr.HalfPointFreeExpr) DrlxParseUtil.findRootNodeViaParent(org.drools.modelcompiler.builder.generator.DrlxParseUtil.findRootNodeViaParent) DeclarationSpec(org.drools.modelcompiler.builder.generator.DeclarationSpec) DrlxParseUtil(org.drools.modelcompiler.builder.generator.DrlxParseUtil) NodeList.nodeList(com.github.javaparser.ast.NodeList.nodeList) Optional.of(java.util.Optional.of) InstanceOfExpr(com.github.javaparser.ast.expr.InstanceOfExpr) NullLiteralExpr(com.github.javaparser.ast.expr.NullLiteralExpr) ParseExpressionErrorResult(org.drools.modelcompiler.builder.errors.ParseExpressionErrorResult) FlattenScope.flattenScope(org.drools.modelcompiler.builder.generator.expressiontyper.FlattenScope.flattenScope) LiteralExpr(com.github.javaparser.ast.expr.LiteralExpr) CharLiteralExpr(com.github.javaparser.ast.expr.CharLiteralExpr) Type(com.github.javaparser.ast.type.Type) ObjectCreationExpr(com.github.javaparser.ast.expr.ObjectCreationExpr) Map(java.util.Map) Expression(com.github.javaparser.ast.expr.Expression) FlattenScope.transformFullyQualifiedInlineCastExpr(org.drools.modelcompiler.builder.generator.expressiontyper.FlattenScope.transformFullyQualifiedInlineCastExpr) ClassUtil.toRawClass(org.drools.modelcompiler.util.ClassUtil.toRawClass) DrlxParseUtil.getClassFromContext(org.drools.modelcompiler.builder.generator.DrlxParseUtil.getClassFromContext) OperatorSpec(org.drools.modelcompiler.builder.generator.operatorspec.OperatorSpec) OOPathExpr(org.drools.mvel.parser.ast.expr.OOPathExpr) PackageModel(org.drools.modelcompiler.builder.PackageModel) SimpleName(com.github.javaparser.ast.expr.SimpleName) ArrayCreationExpr(com.github.javaparser.ast.expr.ArrayCreationExpr) DrlxParseUtil.getExpressionType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.getExpressionType) MethodCallExpr(com.github.javaparser.ast.expr.MethodCallExpr) MapCreationLiteralExpressionKeyValuePair(org.drools.mvel.parser.ast.expr.MapCreationLiteralExpressionKeyValuePair) MethodUtils(org.drools.core.util.MethodUtils) UnaryExpr(com.github.javaparser.ast.expr.UnaryExpr) BlockStmt(com.github.javaparser.ast.stmt.BlockStmt) ArrayInitializerExpr(com.github.javaparser.ast.expr.ArrayInitializerExpr) Optional.empty(java.util.Optional.empty) DrlxParseUtil.replaceAllHalfBinaryChildren(org.drools.modelcompiler.builder.generator.DrlxParseUtil.replaceAllHalfBinaryChildren) PrintUtil.printNode(org.drools.mvel.parser.printer.PrintUtil.printNode) CastExpr(com.github.javaparser.ast.expr.CastExpr) ArrayList(java.util.ArrayList) NullSafeMethodCallExpr(org.drools.mvel.parser.ast.expr.NullSafeMethodCallExpr) DrlxParseUtil.transformDrlNameExprToNameExpr(org.drools.modelcompiler.builder.generator.DrlxParseUtil.transformDrlNameExprToNameExpr) ListCreationLiteralExpressionElement(org.drools.mvel.parser.ast.expr.ListCreationLiteralExpressionElement) UnificationTypedExpression(org.drools.modelcompiler.builder.generator.UnificationTypedExpression) TypeVariable(java.lang.reflect.TypeVariable) NativeOperatorSpec(org.drools.modelcompiler.builder.generator.operatorspec.NativeOperatorSpec) DrlxParseUtil.toClassOrInterfaceType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.toClassOrInterfaceType) DrlNameExpr(org.drools.mvel.parser.ast.expr.DrlNameExpr) InlineCastExpr(org.drools.mvel.parser.ast.expr.InlineCastExpr) NameExpr(com.github.javaparser.ast.expr.NameExpr) Field(java.lang.reflect.Field) InitializerDeclaration(com.github.javaparser.ast.body.InitializerDeclaration) ParameterizedType(java.lang.reflect.ParameterizedType) ModelGenerator(org.drools.modelcompiler.builder.generator.ModelGenerator) MapCreationLiteralExpression(org.drools.mvel.parser.ast.expr.MapCreationLiteralExpression) ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) DrlxParseUtil.prepend(org.drools.modelcompiler.builder.generator.DrlxParseUtil.prepend) DrlxParseUtil.getClassFromType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.getClassFromType) TypeResolver(org.drools.core.addon.TypeResolver) TemporalOperatorSpec(org.drools.modelcompiler.builder.generator.operatorspec.TemporalOperatorSpec) LoggerFactory(org.slf4j.LoggerFactory) ThisExpr(com.github.javaparser.ast.expr.ThisExpr) InvalidExpressionErrorResult(org.drools.modelcompiler.builder.errors.InvalidExpressionErrorResult) ClassUtils.getter2property(org.drools.core.util.ClassUtils.getter2property) DrlxParseUtil.isThisExpression(org.drools.modelcompiler.builder.generator.DrlxParseUtil.isThisExpression) CustomOperatorSpec(org.drools.modelcompiler.builder.generator.operatorspec.CustomOperatorSpec) BinaryExpr(com.github.javaparser.ast.expr.BinaryExpr) Method(java.lang.reflect.Method) Node(com.github.javaparser.ast.Node) NodeList(com.github.javaparser.ast.NodeList) ReferenceType(com.github.javaparser.ast.type.ReferenceType) HalfBinaryExpr(org.drools.mvel.parser.ast.expr.HalfBinaryExpr) ListCreationLiteralExpression(org.drools.mvel.parser.ast.expr.ListCreationLiteralExpression) OOPathChunk(org.drools.mvel.parser.ast.expr.OOPathChunk) FullyQualifiedInlineCastExpr(org.drools.mvel.parser.ast.expr.FullyQualifiedInlineCastExpr) DrlxParseUtil.safeResolveType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.safeResolveType) THIS_PLACEHOLDER(org.drools.modelcompiler.builder.generator.DrlxParseUtil.THIS_PLACEHOLDER) StringLiteralExpr(com.github.javaparser.ast.expr.StringLiteralExpr) EnclosedExpr(com.github.javaparser.ast.expr.EnclosedExpr) List(java.util.List) TypedExpression(org.drools.modelcompiler.builder.generator.TypedExpression) DrlxParseUtil.nameExprToMethodCallExpr(org.drools.modelcompiler.builder.generator.DrlxParseUtil.nameExprToMethodCallExpr) Modifier(java.lang.reflect.Modifier) Optional(java.util.Optional) MvelParser.parseType(org.drools.mvel.parser.MvelParser.parseType) FieldAccessExpr(com.github.javaparser.ast.expr.FieldAccessExpr) DrlxParseUtil.toStringLiteral(org.drools.modelcompiler.builder.generator.DrlxParseUtil.toStringLiteral) NodeWithArguments(com.github.javaparser.ast.nodeTypes.NodeWithArguments) HashMap(java.util.HashMap) ClassUtils.extractGenericType(org.drools.core.util.ClassUtils.extractGenericType) PointFreeExpr(org.drools.mvel.parser.ast.expr.PointFreeExpr) DoubleLiteralExpr(com.github.javaparser.ast.expr.DoubleLiteralExpr) DrlxParseUtil.getLiteralExpressionType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.getLiteralExpressionType) ClassUtil.getTypeArgument(org.drools.modelcompiler.util.ClassUtil.getTypeArgument) RuleUnitUtil.isDataSource(org.kie.internal.ruleunit.RuleUnitUtil.isDataSource) NoSuchElementException(java.util.NoSuchElementException) Logger(org.slf4j.Logger) AssignExpr(com.github.javaparser.ast.expr.AssignExpr) NullSafeFieldAccessExpr(org.drools.mvel.parser.ast.expr.NullSafeFieldAccessExpr) PrintUtil(org.drools.mvel.parser.printer.PrintUtil) RuleContext(org.drools.modelcompiler.builder.generator.RuleContext) DrlxParseUtil.trasformHalfBinaryToBinary(org.drools.modelcompiler.builder.generator.DrlxParseUtil.trasformHalfBinaryToBinary) BigDecimalArgumentCoercion(org.drools.mvelcompiler.util.BigDecimalArgumentCoercion) PrintUtil.printNode(org.drools.mvel.parser.printer.PrintUtil.printNode) Node(com.github.javaparser.ast.Node) DrlxParseUtil.transformDrlNameExprToNameExpr(org.drools.modelcompiler.builder.generator.DrlxParseUtil.transformDrlNameExprToNameExpr) DrlNameExpr(org.drools.mvel.parser.ast.expr.DrlNameExpr) NameExpr(com.github.javaparser.ast.expr.NameExpr) Method(java.lang.reflect.Method) DrlxParseUtil.toClassOrInterfaceType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.toClassOrInterfaceType) ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) ParseExpressionErrorResult(org.drools.modelcompiler.builder.errors.ParseExpressionErrorResult) Field(java.lang.reflect.Field) Type(com.github.javaparser.ast.type.Type) DrlxParseUtil.getExpressionType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.getExpressionType) DrlxParseUtil.toClassOrInterfaceType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.toClassOrInterfaceType) ParameterizedType(java.lang.reflect.ParameterizedType) ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) DrlxParseUtil.getClassFromType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.getClassFromType) ReferenceType(com.github.javaparser.ast.type.ReferenceType) DrlxParseUtil.safeResolveType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.safeResolveType) MvelParser.parseType(org.drools.mvel.parser.MvelParser.parseType) ClassUtils.extractGenericType(org.drools.core.util.ClassUtils.extractGenericType) DrlxParseUtil.getLiteralExpressionType(org.drools.modelcompiler.builder.generator.DrlxParseUtil.getLiteralExpressionType) DeclarationSpec(org.drools.modelcompiler.builder.generator.DeclarationSpec) Expression(com.github.javaparser.ast.expr.Expression) UnificationTypedExpression(org.drools.modelcompiler.builder.generator.UnificationTypedExpression) MapCreationLiteralExpression(org.drools.mvel.parser.ast.expr.MapCreationLiteralExpression) DrlxParseUtil.isThisExpression(org.drools.modelcompiler.builder.generator.DrlxParseUtil.isThisExpression) ListCreationLiteralExpression(org.drools.mvel.parser.ast.expr.ListCreationLiteralExpression) TypedExpression(org.drools.modelcompiler.builder.generator.TypedExpression) FieldAccessExpr(com.github.javaparser.ast.expr.FieldAccessExpr) NullSafeFieldAccessExpr(org.drools.mvel.parser.ast.expr.NullSafeFieldAccessExpr) MethodCallExpr(com.github.javaparser.ast.expr.MethodCallExpr) NullSafeMethodCallExpr(org.drools.mvel.parser.ast.expr.NullSafeMethodCallExpr) DrlxParseUtil.nameExprToMethodCallExpr(org.drools.modelcompiler.builder.generator.DrlxParseUtil.nameExprToMethodCallExpr)

Aggregations

ClassOrInterfaceType (com.github.javaparser.ast.type.ClassOrInterfaceType)76 Expression (com.github.javaparser.ast.expr.Expression)33 ObjectCreationExpr (com.github.javaparser.ast.expr.ObjectCreationExpr)29 Type (com.github.javaparser.ast.type.Type)24 NameExpr (com.github.javaparser.ast.expr.NameExpr)23 BlockStmt (com.github.javaparser.ast.stmt.BlockStmt)21 DrlxParseUtil.toClassOrInterfaceType (org.drools.modelcompiler.builder.generator.DrlxParseUtil.toClassOrInterfaceType)21 MethodDeclaration (com.github.javaparser.ast.body.MethodDeclaration)17 MethodCallExpr (com.github.javaparser.ast.expr.MethodCallExpr)17 NodeList (com.github.javaparser.ast.NodeList)14 ReturnStmt (com.github.javaparser.ast.stmt.ReturnStmt)13 TypeParameter (com.github.javaparser.ast.type.TypeParameter)13 StaticJavaParser.parseClassOrInterfaceType (com.github.javaparser.StaticJavaParser.parseClassOrInterfaceType)12 Test (org.junit.Test)11 StaticJavaParser.parseType (com.github.javaparser.StaticJavaParser.parseType)9 List (java.util.List)9 ClassOrInterfaceDeclaration (com.github.javaparser.ast.body.ClassOrInterfaceDeclaration)8 StringLiteralExpr (com.github.javaparser.ast.expr.StringLiteralExpr)7 ExpressionStmt (com.github.javaparser.ast.stmt.ExpressionStmt)7 HashMap (java.util.HashMap)7