Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.MethodInvocation.arguments()


  private boolean setHeightString(int height) throws Exception {
    MethodInvocation invocation = m_window.getMethodInvocation("setHeight(java.lang.String)");
    if (invocation != null) {
      AstEditor editor = m_window.getEditor();
      editor.replaceExpression(
          (Expression) invocation.arguments().get(0),
          "\"" + Integer.toString(height) + "px\"");
      return true;
    }
    // not found
    return false;
View Full Code Here


  @Override
  public boolean isJavaInfo(ASTNode node) {
    if (node instanceof MethodInvocation) {
      MethodInvocation invocation = (MethodInvocation) node;
      return invocation.arguments().isEmpty()
          && invocation.getName().getIdentifier().equals("getLayout")
          && m_container.isRepresentedBy(invocation.getExpression());
    }
    return false;
  }
View Full Code Here

      return false;
    }

    if (parent instanceof MethodInvocation) {
      MethodInvocation mi = (MethodInvocation) parent;
      if (mi.arguments().contains(node)
          && !TypeUtil
              .isOverloaded(mi.resolveMethodBinding(), object)) {
        return false;
      }
    }
View Full Code Here

    SimpleName methodName = ast.newSimpleName(methodId.toLowerCase());

    MethodInvocation methInv = ast.newMethodInvocation();
    methInv.setName(methodName);
    if (parameter != null)
      methInv.arguments().add(parameter);

    methInv.setExpression(instExpr);

    result = methInv;
View Full Code Here

      result = superMethInv;
    } else {
      MethodInvocation methInv = ast.newMethodInvocation();
      methInv.setName(methodName);
      if (parameter != null)
        methInv.arguments().add(parameter);
      if (qualifier.equals("this__0")) {
        ThisExpression thisExpression = ast.newThisExpression();
        // radom
        // o this pode ser qualificado ou nao
        // Random generator = new Random();
View Full Code Here

      // Add parameters to wrapDataProvider()
      // 1) the current class
      TypeLiteral tl = ast.newTypeLiteral();
      tl.setType(ast.newSimpleType(ast.newSimpleName(visitor.getType().getName().toString())));
      mi.arguments().add(tl);

      // 2) the call to the @Parameters method
      MethodInvocation pmi = ast.newMethodInvocation();
      pmi.setName(ast.newSimpleName(parameterMethod.getName().getFullyQualifiedName()));
      mi.arguments().add(pmi);
View Full Code Here

  private void testCorrectMethodInvocation(String methodName, String returnType, String[] argTypes, boolean isStatic) {
    MethodInvocation invocation = QuickfixUtils.getMockMethodInvocation(methodName, argTypes, returnType, isStatic);

    assertEquals("Expects method name = " + methodName, methodName, invocation.getName().getIdentifier());
    assertEquals("Expects number of arguments = " + argTypes.length, argTypes.length, invocation.arguments().size());

    assertEquals("Expects static = " + isStatic, isStatic, ASTResolving.isInStaticContext(invocation));
  }

  public void testGetMockConstructorInvocation() {
View Full Code Here

  @SuppressWarnings("unchecked")
  protected List<Expression> getArguments(Expression invocationExpression) {
    MethodInvocation methodInvocation = (MethodInvocation) invocationExpression;
    List<Expression> arguments = new ArrayList<Expression>();
    for (Iterator<Expression> argumentIter = methodInvocation.arguments().iterator(); argumentIter.hasNext();) {
      Expression argumentExpression = argumentIter.next();
      arguments.add(argumentExpression);
    }
    return arguments;
  }
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.