Package japa.parser.ast.stmt

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


        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

        }

        // 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

            // 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

  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

        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

        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

        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

        throw new Error("Missing return statement in function");
    }

    final public SynchronizedStmt SynchronizedStatement() throws ParseException {
        Expression expr;
        BlockStmt block;
        int line;
        int column;
        jj_consume_token(SYNCHRONIZED);
        line = token.beginLine;
        column = token.beginColumn;
View Full Code Here

        }
        throw new Error("Missing return statement in function");
    }

    final public TryStmt TryStatement() throws ParseException {
        BlockStmt tryBlock;
        BlockStmt finallyBlock = null;
        List catchs = null;
        Parameter except;
        BlockStmt catchBlock;
        int line;
        int column;
        int cLine;
        int cColumn;
        jj_consume_token(TRY);
View Full Code Here

TOP

Related Classes of japa.parser.ast.stmt.BlockStmt

Copyright © 2018 www.massapicom. 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.