Package org.eclipse.jdt.core.dom

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


     *
     * @param mname method name
     * @return builder
     */
    public InvocationBuilder createMemberMethodCall(String mname) {
        MethodInvocation methcall = getAST().newMethodInvocation();
        methcall.setName(getAST().newSimpleName(mname));
        return new InvocationBuilder(this, methcall);
    }
View Full Code Here


     *
     * @param mname method name
     * @return builder
     */
    public InvocationBuilder createLocalStaticMethodCall(String mname) {
        MethodInvocation methcall = getAST().newMethodInvocation();
        methcall.setName(getAST().newSimpleName(mname));
        return new InvocationBuilder(this, methcall);
    }
View Full Code Here

     * @param cname fully qualified class name
     * @param mname method name
     * @return builder
     */
    public InvocationBuilder createStaticMethodCall(String cname, String mname) {
        MethodInvocation methcall = getAST().newMethodInvocation();
        methcall.setExpression(getAST().newName(cname));
        methcall.setName(getAST().newSimpleName(mname));
        return new InvocationBuilder(this, methcall);
    }
View Full Code Here

     * @param name local variable or field name
     * @param mname method name
     * @return builder
     */
    public InvocationBuilder createNormalMethodCall(String name, String mname) {
        MethodInvocation methcall = getAST().newMethodInvocation();
        methcall.setExpression(getAST().newSimpleName(name));
        methcall.setName(getAST().newSimpleName(mname));
        return new InvocationBuilder(this, methcall);
    }
View Full Code Here

     * @param expr instance expression
     * @param mname method name
     * @return builder
     */
    public InvocationBuilder createExpressionMethodCall(ExpressionBuilderBase expr, String mname) {
        MethodInvocation methcall = getAST().newMethodInvocation();
        methcall.setExpression(expr.getExpression());
        methcall.setName(getAST().newSimpleName(mname));
        return new InvocationBuilder(this, methcall);
    }
View Full Code Here

     * @param type variable type (must be an iterator subclass or generic type)
     * @param init variable initialization expression
     * @param block statement body block
     */
    public void addIteratedForStatement(String name, Type type, ExpressionBuilderBase init, BlockBuilder block) {
        MethodInvocation methcall = m_ast.newMethodInvocation();
        methcall.setExpression(m_ast.newSimpleName(name));
        methcall.setName(m_ast.newSimpleName("hasNext"));
        addForStatement(name, type, init.getExpression(), methcall, null, block);
    }
View Full Code Here

    Type typeNode = creation.getType();
    boolean invokesGetInst = false;

    if (gparent instanceof MethodInvocation) // method invocation follows
    {
      MethodInvocation inv = (MethodInvocation) gparent;
      IMethodBinding meth = inv.resolveMethodBinding();

      if ( MockUtil.GET_INST.equals(meth.getName()))
      {
        invokesGetInst = true;
        if (gparent.getParent() instanceof ExpressionStatement)
        {
          addMarker(inv.getName(), "Returned mock instance is not being used.", false);
        }
      }
    }

    if( !invokesGetInst )
View Full Code Here

        ImportDeclaration id = (ImportDeclaration) ASTNodes.getParent(selectedNode,
            ASTNode.IMPORT_DECLARATION);

        if (id == null)
        {
            MethodInvocation m = (MethodInvocation) ASTNodes.getParent(selectedNode,
                ASTNode.METHOD_INVOCATION);

            if (m != null)
            {
                packages.add(readPackage(m));
                while (m.getExpression() != null
                    && m.getExpression() instanceof MethodInvocation)
                {
                    m = (MethodInvocation) m.getExpression();
                    packages.add(readPackage(m));
                }
            }
        }
        else
View Full Code Here

        "var person = Find.typeByName('Person');\n" +
        "var ast = AST.parseCompilationUnit(person.getCompilationUnit());\n" +
        "var node = AST.findCoveredNode(ast, " + offsetOfCall + ", " + methodCallText.length() + ");\n"
        , null, "inline script");

    MethodInvocation node = runScript.getProperty(MethodInvocation.class, "node");
   
    assertThat(node, is(notNullValue()));
    assertThat(node.getExpression().toString(), is("person"));
    assertThat(node.getName().toString(), is("setName"));
    assertThat((List<ASTNode>) node.arguments(),
           Matchers.<ASTNode>hasItems(a_node().with_text_representation("\"Bob\"")));
  }
View Full Code Here

  private Component getTabComponent(MethodInvocation methodInvocation,
      List arguments) {
    Expression exp = (Expression) arguments.get(2);
    if (exp != null && exp instanceof MethodInvocation) {
      MethodInvocation mi = (MethodInvocation) exp;
      String getMethodName = mi.getName().getFullyQualifiedName();
      String fieldName = getFieldNameFromGetMethodName(methodInvocation,
          getMethodName);
      if (fieldName != null) {
        CompositeAdapter tabAdapter = (CompositeAdapter) adaptable;
        int count = tabAdapter.getChildCount();
View Full Code Here

TOP

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

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.