Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.ExpressionStatement


    }

    public void andAssignTo(FieldInfo fieldInfo) {
      Assignment assignment = ast.newAssignment();

      ExpressionStatement statement = ast.newExpressionStatement(assignment);
      block.statements().add(statement);

      MethodInvocation invocation = getterInfo.toMethodInvocation(ast, name);
      assignment.setRightHandSide(invocation);
      assignment.setOperator(Operator.ASSIGN);
View Full Code Here


    md.setBody(block);

    MethodInvocation mi = ast.newMethodInvocation();
    mi.setName(ast.newSimpleName("x"));

    ExpressionStatement e = ast.newExpressionStatement(mi);
    block.statements().add(e);

    System.out.println(cu);
  }
View Full Code Here

    IMethodBinding definition = BindingUtils.findMethodDefininition(invocation.resolveMethodBinding(), null);
    assertEquals("sharpen.ui.tests.BindingTestCaseSubject.Foo.bar", BindingUtils.qualifiedName(definition));
  }

  private MethodInvocation getFirstMethodInvocation(MethodDeclaration method) {
    ExpressionStatement stmt = (ExpressionStatement) method.getBody().statements().get(0);
    MethodInvocation invocation = (MethodInvocation) stmt.getExpression();
    return invocation;
  }
View Full Code Here

          .setOperator(org.eclipse.jdt.core.dom.Assignment.Operator.ASSIGN);
      assignment.setLeftHandSide(fieldAccess);
      assignment.setRightHandSide(parameter);

      // Expression
      ExpressionStatement expressionStatement = ast
          .newExpressionStatement(assignment);

      block.statements().add(expressionStatement);
    }
View Full Code Here

    md.setBody(block);

    MethodInvocation mi = ast.newMethodInvocation();
    mi.setName(ast.newSimpleName("x"));

    ExpressionStatement e = ast.newExpressionStatement(mi);
    block.statements().add(e);

    System.out.println(cu);
  }
View Full Code Here

    String mockMethodInvocationCode = getNewMethodName() + "(" + getNewMethodParameters() + ");";
    fooParser.setSource(mockMethodInvocationCode.toCharArray());
    fooParser.setResolveBindings(true);
    ASTNode parsedAstNode = fooParser.createAST(null);
    Block codeBlock = (Block) parsedAstNode;
    ExpressionStatement methodInvocationExpressionStatement = (ExpressionStatement) codeBlock.statements().get(0);
    return methodInvocationExpressionStatement.getExpression();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.ExpressionStatement

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.