Examples of BlockStmt


Examples of com.github.antlrjavaparser.api.stmt.BlockStmt

        }

        // Set the body
        if (constructor.getBody() == null
                || constructor.getBody().length() == 0) {
            d.setBlock(new BlockStmt());
        }
        else {
            // There is a body.
            // We need to make a fake constructor that we can have JavaParser
            // parse.
View Full Code Here

Examples of com.github.antlrjavaparser.api.stmt.BlockStmt

            // Never set the body if an abstract method
            if (!Modifier.isAbstract(method.getModifier())
                    && !PhysicalTypeCategory.INTERFACE
                            .equals(compilationUnitServices
                                    .getPhysicalTypeCategory())) {
                d.setBody(new BlockStmt());
            }
        }
        else {
            // There is a body.
            // We need to make a fake method that we can have JavaParser parse.
View Full Code Here

Examples of japa.parser.ast.stmt.BlockStmt

        List<AnnotationExpr> annotationExprList = new ArrayList<AnnotationExpr>();
//        annotationExprList.add(markerAnnotationExpr);
        annotationExprList.add(normalAnnotationExpr);
        method.getParameters().clear();
        method.setAnnotations(annotationExprList);
        method.setBody(new BlockStmt());
        ASTHelper.addMember(type, method);
        return this;
    }
View Full Code Here

Examples of japa.parser.ast.stmt.BlockStmt

        Parameter param = ASTHelper.createParameter(ASTHelper.createReferenceType("String", 1), "args");
//        param.setVarArgs(true);
        ASTHelper.addParameter(method, param);

        //add a body to the method
        BlockStmt block = new BlockStmt();
        method.setBody(block);

        //add a statement do the method body
        NameExpr clazz = new NameExpr("System");
        FieldAccessExpr field = new FieldAccessExpr(clazz, "out");
View Full Code Here

Examples of japa.parser.ast.stmt.BlockStmt

        }

        // Set the body
        if (constructor.getBody() == null
                || constructor.getBody().length() == 0) {
            d.setBlock(new BlockStmt());
        }
        else {
            // There is a body.
            // We need to make a fake constructor that we can have JavaParser
            // parse.
View Full Code Here

Examples of japa.parser.ast.stmt.BlockStmt

            // Never set the body if an abstract method
            if (!Modifier.isAbstract(method.getModifier())
                    && !PhysicalTypeCategory.INTERFACE
                            .equals(compilationUnitServices
                                    .getPhysicalTypeCategory())) {
                d.setBody(new BlockStmt());
            }
        }
        else {
            // There is a body.
            // We need to make a fake method that we can have JavaParser parse.
View Full Code Here

Examples of japa.parser.ast.stmt.BlockStmt

  public void visit(MethodDeclaration n, Object arg) {
    if ("".equals(getSearchMethodName())) {
      if (n.getBody() == null) {
        printer.print(";");
      } else {
        BlockStmt bm = n.getBody();
        List<Statement> smList = bm.getStmts();
        for (Statement sm : smList) {
          printer.printLn(sm.toString());
        }
        n.getBody().accept(this, arg);
      }
    } else {
      if (n.getName().equals(getSearchMethodName())) {
        if (n.getBody() == null) {
          printer.print(";");
        } else {
          BlockStmt bm = n.getBody();
          List<Statement> smList = bm.getStmts();
          for (Statement sm : smList) {
            printer.printLn(sm.toString());
          }
          n.getBody().accept(this, arg);
        }
View Full Code Here

Examples of japa.parser.ast.stmt.BlockStmt

        Parameter param = ASTHelper.createParameter(ASTHelper.createReferenceType("String", 1), "args");
//        param.setVarArgs(true);
        ASTHelper.addParameter(method, param);

        //add a body to the method
        BlockStmt block = new BlockStmt();
        method.setBody(block);

        //add a statement do the method body
        NameExpr clazz = new NameExpr("System");
        FieldAccessExpr field = new FieldAccessExpr(clazz, "out");
View Full Code Here

Examples of japa.parser.ast.stmt.BlockStmt

        annotationExprList.add(normalAnnotationExpr);
        if (null != method.getParameters()) {
            method.getParameters().clear();
        }
        method.setAnnotations(annotationExprList);
        method.setBody(new BlockStmt());
        ASTHelper.addMember(type, method);
        return this;
    }
View Full Code Here

Examples of japa.parser.ast.stmt.BlockStmt

        return Boolean.TRUE;
    }

    public Boolean visit(BlockStmt n1, Node arg) {
        BlockStmt n2 = (BlockStmt) arg;

        if (!nodesEquals(n1.getStmts(), n2.getStmts())) {
            return Boolean.FALSE;
        }

        return Boolean.TRUE;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.