Package org.eclipse.jdt.core.dom

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


          parent, HistoryDefinitionLocation.CLASS_INSTANCE_CREATION);
      }else
        cc=parent;
      String aux=(c.getType()).toString();
      if(SinkView.isDerivationName(aux)){
        for(Object arg:c.arguments()){
          if(registerExpansion(cc))
          processExpression(cc,(Expression)arg,cu,resource,stack,monitor,HistoryDefinitionLocation.DERIVATION,false);
        }
    }
      }
View Full Code Here


                                        arg = (Expression) mi.arguments().get(argumentNumber);
                                    }
                                   
                                } else if (expr instanceof ClassInstanceCreation) {
                                    ClassInstanceCreation ci = (ClassInstanceCreation) expr;
                                    argCount = ci.arguments().size();
                                    if (argCount > 0) {
                                        arg = (Expression) ci.arguments().get(argumentNumber);
                                    }
                                  
                                } else {
View Full Code Here

                                   
                                } else if (expr instanceof ClassInstanceCreation) {
                                    ClassInstanceCreation ci = (ClassInstanceCreation) expr;
                                    argCount = ci.arguments().size();
                                    if (argCount > 0) {
                                        arg = (Expression) ci.arguments().get(argumentNumber);
                                    }
                                  
                                } else {
                                    logError("Can't match " + expr + " of type " + expr.getClass());
                                 
View Full Code Here

                VariableDeclarationFragment vdf = (VariableDeclarationFragment) varDeclarationFragment;
               
                ClassInstanceCreation newClassInstanceCreation = vdf.getAST().newClassInstanceCreation();
                Type newType = JDTUtils.createQualifiedType(vdf.getAST(), toClass);
                newClassInstanceCreation.setType(newType);
                List arguments = newClassInstanceCreation.arguments();
                arguments.clear();
               
                MethodInvocation initializer = (MethodInvocation) vdf.getInitializer();
                List newArguments = ASTNode.copySubtrees(newClassInstanceCreation.getAST(), initializer.arguments());
                arguments.addAll(newArguments);
View Full Code Here

    }

    case ASTNode.CLASS_INSTANCE_CREATION: {
      final ClassInstanceCreation ctorCall = (ClassInstanceCreation) node;
      // if coming up from a argument.
      if (containedIn(ctorCall.arguments(), this.name))
        // if we don't have the source, no can do.
        if (!ctorCall.getType().resolveBinding().isFromSource())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, node);
        else
View Full Code Here

    }

    case ASTNode.CONSTRUCTOR_INVOCATION: {
      final ConstructorInvocation ctorCall = (ConstructorInvocation) node;
      // if coming up from a argument.
      if (containedIn(ctorCall.arguments(), this.name))
        // if we don't have the source, no can do.
        if (!ctorCall.resolveConstructorBinding().getDeclaringClass()
            .isFromSource())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, node);
View Full Code Here

    }

    case ASTNode.SUPER_CONSTRUCTOR_INVOCATION: {
      final SuperConstructorInvocation ctorCall = (SuperConstructorInvocation) node;
      // if coming up from a argument.
      if (containedIn(ctorCall.arguments(), this.name))
        // if we don't have the source, no can do.
        if (!ctorCall.resolveConstructorBinding().getDeclaringClass()
            .isFromSource())
          throw new DefinitelyNotEnumerizableException(
              Messages.ASTNodeProcessor_SourceNotPresent, node);
View Full Code Here

  @Override
  @SuppressWarnings("unchecked")
  protected List<Expression> getArguments(Expression invocationExpression) {
    ClassInstanceCreation methodInvocation = (ClassInstanceCreation) 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

    SimpleType simpleType = (SimpleType) type;
    assertEquals("Expects invocation class name = " + className, className, simpleType.getName()
        .getFullyQualifiedName());

    assertEquals("Expects number of arguments = " + argTypes.length, argTypes.length, invocation.arguments().size());
  }

  private void testCorrectMethodInvocation(String methodName, String returnType, String[] argTypes, boolean isStatic) {
    MethodInvocation invocation = QuickfixUtils.getMockMethodInvocation(methodName, argTypes, returnType, isStatic);
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.