Package org.eclipse.jdt.core.dom

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


      String umlQualifiedTypeName, String umlPropertyName,
      String sourceDirectoryPackageName) {
    Type chosenType = getChosenType(ast, umlTypeName, umlQualifiedTypeName,
        sourceDirectoryPackageName);

    SingleVariableDeclaration variableDeclaration = ast
        .newSingleVariableDeclaration();
    variableDeclaration.setType(chosenType);
    variableDeclaration.setName(ast.newSimpleName(umlPropertyName));
    md.parameters().add(variableDeclaration);
  }
View Full Code Here


    // Create Collection
    SimpleType collectionType = ast.newSimpleType(ast
        .newName(collectionTypeConstant));
    ParameterizedType pt = ast.newParameterizedType(collectionType);
    pt.typeArguments().add(chosenType);
    SingleVariableDeclaration variableDeclaration = ast
        .newSingleVariableDeclaration();
    variableDeclaration.setType(pt);
    variableDeclaration.setName(ast.newSimpleName(umlPropertyName));
    md.parameters().add(variableDeclaration);
  }
View Full Code Here

    Element elem = (Element) xmlElementStack.peek();
    if (node.isConstructor()) {
      elem.setAttribute("constructor", "true");
    }
    for (int i = 0; i < node.parameters().size(); i++) {
      SingleVariableDeclaration dec = (SingleVariableDeclaration) node
          .parameters().get(i);
      if (!dec.getType().isPrimitiveType()) {
        IBinding binding = dec.getName().resolveBinding();
        namesFromHeap.add(binding);
      }
      // System.out.println(dec);
    }
    return true;
View Full Code Here

        Modifier m = getAccessModifier(vis);
        if (m != null)
          methodDeclaration.modifiers().add(m);

        if (arg.length() > 0) {
          SingleVariableDeclaration parameter = ast
              .newSingleVariableDeclaration();
          parameter.setName(ast.newSimpleName("a"));
          parameter.setType(getType(arg));
          methodDeclaration.parameters().add(parameter);
        }

        methodDeclaration.setReturnType2(ast
            .newPrimitiveType(PrimitiveType.LONG));
View Full Code Here

    if (node == null || node instanceof BodyDeclaration) {
      return node;
    }

    if (node instanceof SingleVariableDeclaration) {
      SingleVariableDeclaration decl = (SingleVariableDeclaration) node;
      if (decl.getParent() instanceof MethodDeclaration) {
        return decl;
      }
    }

    return getSurroundingDecl(node.getParent());
View Full Code Here

        }

        return proposals;
      }
      else if (decl instanceof SingleVariableDeclaration) {
        SingleVariableDeclaration varDecl = (SingleVariableDeclaration) decl;

        return checkAndReturnAssists(varDecl, varDecl.getName(), context);
      }
      else if (decl instanceof MethodDeclaration) {
        MethodDeclaration methodDecl = (MethodDeclaration) decl;
        Block body = methodDecl.getBody();
View Full Code Here

              // cursor is at the start of a param type
              else if (parentNode instanceof SimpleType) {
                SimpleType sType = (SimpleType) parentNode;
                parentNode = sType.getParent();
                if (parentNode instanceof SingleVariableDeclaration) {
                  SingleVariableDeclaration varDecl = (SingleVariableDeclaration) parentNode;
                  parentNode = varDecl.getParent();
                  if (parentNode instanceof MethodDeclaration) {
                    MethodDeclaration methodDecl = (MethodDeclaration) parentNode;
                    return getProposals(methodDecl, sType.getName().getFullyQualifiedName(),
                        invocationOffset, sType, javaContext);
                  }
View Full Code Here

    List<SingleVariableDeclaration> params = decl.parameters();
    for (int i = 0; i < params.size(); i++) {
      if (i > 0) {
        displayName.append(", ");
      }
      SingleVariableDeclaration currentParam = params.get(i);
      displayName.append(ProposalCalculatorUtil.getTypeName(currentParam.getType()));
      displayName.append(" ");

      if (currentParam == param) {
        displayName.append(variableName);
      }
      else {
        displayName.append(currentParam.getName().getFullyQualifiedName());
      }
    }
    displayName.append(")");

    setDisplayName(displayName.toString());
View Full Code Here

      public int getLength() {
        return variable.getVariableName().length();
      }
    }, true, "variableName");

    SingleVariableDeclaration paramDecl = ast.newSingleVariableDeclaration();

    SimpleType variableType = ast.newSimpleType(ast.newSimpleName("String"));
    paramDecl.setType(variableType);
    addLinkedPosition(astRewrite.track(variableType), false, "variableType");

    SimpleName variableName = ast.newSimpleName(variable.getVariableName());
    paramDecl.setName(variableName);
    addLinkedPosition(astRewrite.track(variableName), false, "variableName");

    SingleMemberAnnotation annotation = ast.newSingleMemberAnnotation();
    annotation.setTypeName(ast.newSimpleName("PathVariable"));
View Full Code Here

                    // - start));
                  }
                  else if (decl instanceof MethodDeclaration) {
                    // MethodDeclaration methodDecl =
                    // (MethodDeclaration) decl;
                    SingleVariableDeclaration variableDecl = getParentVariableDeclaration(annotationNode);
                    if (variableDecl != null) {
                      // ITypeBinding typeBinding =
                      // variableDecl.getType().resolveBinding();
                      proposals.add(new QualifierCompletionProposal(annotationNode, decl,
                          javaContext));
View Full Code Here

TOP

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

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.