Package japa.parser.ast.stmt

Examples of japa.parser.ast.stmt.BlockStmt


        this.state = state;
    }

    @Given("a BlockStmt")
    public void givenABlockStatement() {
        blockStmt = new BlockStmt();
    }
View Full Code Here


    }

    @When("a BlockStmt is added to method $methodPosition in class $classPosition")
    public void whenABlockStmtIsAddedToMethodInClass(int methodPosition, int classPosition) {
        MethodDeclaration method = getMethodByPositionAndClassPosition(methodPosition, classPosition);
        method.setBody(new BlockStmt());
    }
View Full Code Here

    JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
    List<Parameter> parameters = visit(_n.getParameters(), _arg);
    List<NameExpr> throws_ = visit(_n.getThrows(), _arg);
    BlockStmt block = cloneNodes(_n.getBlock(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    ConstructorDeclaration r = new ConstructorDeclaration(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
         _n.getModifiers(), annotations, typeParameters, _n.getName(), parameters, throws_, block
View Full Code Here

    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
    Type type_ = cloneNodes(_n.getType(), _arg);
    List<Parameter> parameters = visit(_n.getParameters(), _arg);
    List<NameExpr> throws_ = visit(_n.getThrows(), _arg);
    BlockStmt block = cloneNodes(_n.getBody(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    MethodDeclaration r = new MethodDeclaration(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
         _n.getModifiers(), annotations, typeParameters, type_, _n.getName(), parameters, _n.getArrayCount(), throws_, block
View Full Code Here

  }

  @Override
  public Node visit(InitializerDeclaration _n, Object _arg) {
    JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
    BlockStmt block = cloneNodes(_n.getBlock(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    InitializerDeclaration r = new InitializerDeclaration(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
         _n.isStatic(), block
View Full Code Here

  @Override
  public Node visit(BlockStmt _n, Object _arg) {
    List<Statement> stmts = visit(_n.getStmts(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    BlockStmt r = new BlockStmt(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        stmts
    );
    r.setComment(comment);
    return r;
  }
View Full Code Here

  }

  @Override
  public Node visit(SynchronizedStmt _n, Object _arg) {
    Expression expr = cloneNodes(_n.getExpr(), _arg);
    BlockStmt block = cloneNodes(_n.getBlock(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    SynchronizedStmt r = new SynchronizedStmt(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        expr, block
View Full Code Here

  }

  @Override
  public Node visit(TryStmt _n, Object _arg) {
    List<VariableDeclarationExpr> resources = visit(_n.getResources(),_arg);
    BlockStmt tryBlock = cloneNodes(_n.getTryBlock(), _arg);
    List<CatchClause> catchs = visit(_n.getCatchs(), _arg);
    BlockStmt finallyBlock = cloneNodes(_n.getFinallyBlock(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    TryStmt r = new TryStmt(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        resources, tryBlock, catchs, finallyBlock
View Full Code Here

  }

  @Override
  public Node visit(CatchClause _n, Object _arg) {
    MultiTypeParameter except = cloneNodes(_n.getExcept(), _arg);
    BlockStmt catchBlock = cloneNodes(_n.getCatchBlock(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    CatchClause r = new CatchClause(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        except.getModifiers(), except.getAnnotations(), except.getTypes(), except.getId(), catchBlock
View Full Code Here

    return Boolean.TRUE;
  }

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

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

    return Boolean.TRUE;
  }
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.