Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.parameters()


      if (node.getNode() instanceof MethodDeclaration) {
        MethodDeclaration md = (MethodDeclaration) node.getNode();
        if (!md.isConstructor())
          type = md.getReturnType2().toString();
        fullName.append('(');
        if (!md.parameters().isEmpty()) {
          List<ASTNode> params = md.parameters();
          for (ASTNode par : params) {
            if (par instanceof SingleVariableDeclaration) {
              SingleVariableDeclaration svd = (SingleVariableDeclaration) par;
              fullName.append(svd.getType() + " " + svd.getName() + ",");
View Full Code Here


        MethodDeclaration md = (MethodDeclaration) node.getNode();
        if (!md.isConstructor())
          type = md.getReturnType2().toString();
        fullName.append('(');
        if (!md.parameters().isEmpty()) {
          List<ASTNode> params = md.parameters();
          for (ASTNode par : params) {
            if (par instanceof SingleVariableDeclaration) {
              SingleVariableDeclaration svd = (SingleVariableDeclaration) par;
              fullName.append(svd.getType() + " " + svd.getName() + ",");
            }
View Full Code Here

    String umlPropertyName = "person";
    jdtHelper.createParameterTypes(ast, td, md, umlTypeName,
        umlQualifiedTypeName, umlPropertyName,
        sourceDirectoryPackageName);

    SingleVariableDeclaration variableDeclaration = (SingleVariableDeclaration) md
        .parameters().get(0);
    assertEquals("Person person", variableDeclaration.toString());
  }

  @Test
View Full Code Here

    String umlPropertyName = "persons";
    jdtHelper.createParameterTypesAsCollection(ast, td, md, umlTypeName,
        umlQualifiedTypeName, umlPropertyName,
        sourceDirectoryPackageName, JdtHelper.JAVA_UTIL_COLLECTION);

    SingleVariableDeclaration variableDeclaration = (SingleVariableDeclaration) md
        .parameters().get(0);
    assertEquals("java.util.Collection<Person> persons",
        variableDeclaration.toString());
  }
View Full Code Here

        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

          methodSourceRange.getOffset(), methodSourceRange.getLength());
      node = assistContext.getCoveringNode();
      if (node instanceof MethodDeclaration) {
        MethodDeclaration methodDecl = (MethodDeclaration) node;
        @SuppressWarnings("unchecked")
        List<SingleVariableDeclaration> parameters = methodDecl.parameters();
        for (SingleVariableDeclaration parameter : parameters) {
          Set<Annotation> annotations = ProposalCalculatorUtil.findAnnotations("Qualifier", invocationOffset,
              parameter);
          for (Annotation an : annotations) {
            if (an.equals(annotation)) {
View Full Code Here

    if (methodDecl == null) {
      return new IMarkerResolution[0];
    }
   
    @SuppressWarnings("unchecked")
    List<SingleVariableDeclaration> parameters = methodDecl.parameters();
    if (parameters.size() != 1) {
      return new IMarkerResolution[0];
    }
   
    String propertyTypeName = marker.getAttribute(InvalidParameterTypeRule.PROPERTY_TYPE_ATTR, null);
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.