Examples of insertFirst()


Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertFirst()

    ASTRewrite rewrite = ASTRewrite.create(declaration.getAST());
   
    ChildListPropertyDescriptor modifiersProperty = declaration.getModifiersProperty();
   
    ListRewrite listRewrite = rewrite.getListRewrite(declaration, modifiersProperty);
    listRewrite.insertFirst(normalAnnotation, null);

    maintainValuesProperty(normalAnnotation, memberValues, ast, rewrite);

    TextEdit importEdits = null;
    ImportRewrite importRewrite = ImportRewrite.create(compilationUnit, true);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertFirst()

    parser.setSource(compilationUnit);
   
    ASTRewrite rewrite = ASTRewrite.create(declaration.getAST());
   
    ListRewrite listRewrite = rewrite.getListRewrite(declaration, SingleVariableDeclaration.MODIFIERS2_PROPERTY);
    listRewrite.insertFirst(normalAnnotation, null);

    maintainValuesProperty(normalAnnotation, memberValues, ast, rewrite);

    TextEdit importEdits = null;
    ImportRewrite importRewrite = ImportRewrite.create(compilationUnit, true);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertFirst()

    //
    ListRewrite lr = result.getListRewrite(astRoot, CompilationUnit.IMPORTS_PROPERTY);
    ImportDeclaration id = ast.newImportDeclaration();
    id.setStatic(true);
    id.setName(ast.newName("org.testng.AssertJUnit." + m_assert));
    lr.insertFirst(id, null);

    return result;
  }

  public String getName() {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertFirst()

    // Add @Test at the class level
    //
    MarkerAnnotation test = ast.newMarkerAnnotation();
    test.setTypeName(ast.newName("Test"));
    ListRewrite lr = result.getListRewrite(visitor.getType(), TypeDeclaration.MODIFIERS2_PROPERTY);
    lr.insertFirst(test, null);

    return result;
  }

  public String getName() {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertFirst()

      mvp.setName(ast.newSimpleName("enabled"));
      mvp.setValue(ast.newBooleanLiteral(false));
      test.values().add(mvp);
      result.remove(ignored, null);
      ListRewrite lr = result.getListRewrite(md, MethodDeclaration.MODIFIERS2_PROPERTY);
      lr.insertFirst(test, null);
    }

    //
    // Replace "Assert" with "AssertJUnit", unless the method is already imported statically.
    //
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertFirst()

      Block block = ast.newBlock();
      block.statements().add(returnStatement);
      md.setBody(block);

      lr.insertFirst(md, null);
    }

    return result;
  }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertFirst()

      boolean isStatic) {
    ListRewrite lr = rewriter.getListRewrite(astRoot, CompilationUnit.IMPORTS_PROPERTY);
    ImportDeclaration id = ast.newImportDeclaration();
    id.setStatic(isStatic);
    id.setName(ast.newName(imp));
    lr.insertFirst(id, null);
  }

  /**
   * Add the given annotation if the method is non null
   */
 
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertFirst()

        }
      }
    }

    // Add the annotation
    lr.insertFirst(a, null);
  }

  public String getName() {
    return "Convert to TestNG (Annotations)";
 
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertFirst()

    //
    for (MethodDeclaration md : visitor.getPublicMethods()) {
      ListRewrite lr = result.getListRewrite(md, MethodDeclaration.MODIFIERS2_PROPERTY);
      MarkerAnnotation test = ast.newMarkerAnnotation();
      test.setTypeName(ast.newSimpleName("Test"));
      lr.insertFirst(test, null);
    }

    return result;
  }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertFirst()

    else {
      property = MethodDeclaration.MODIFIERS2_PROPERTY;
    }

    ListRewrite listRewrite = astRewrite.getListRewrite(decl, property);
    listRewrite.insertFirst(annotation, null);

    return astRewrite;
  }

  // private static String getDisplayName(String qualifier) {
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.