Examples of ImportRewrite


Examples of org.eclipse.jdt.core.dom.rewrite.ImportRewrite

    AST ast = astRewrite.getAST();

    String importName = PathVariable.class.getCanonicalName();
    if (!ProposalCalculatorUtil.containsImport(getCompilationUnit(), importName)) {
      ImportRewrite importRewrite = createImportRewrite(astRoot);
      importRewrite.addImport(importName);
    }

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

Examples of org.eclipse.jdt.core.dom.rewrite.ImportRewrite

  protected ASTRewrite getRewrite() throws CoreException {

    CompilationUnit astRoot = ASTResolving.findParentCompilationUnit(typeDecl);
    AST ast = astRoot.getAST();
    ASTRewrite astRewrite = ASTRewrite.create(ast);
    ImportRewrite importRewrite = StubUtility.createImportRewrite(astRoot, true);
    ListRewrite listRewriter = astRewrite.getListRewrite(typeDecl, (typeDecl).getBodyDeclarationsProperty());

    if (listRewriter != null) {
      IJavaProject javaProject = compilationUnit.getJavaProject();
      CodeGenerationSettings settings = JavaPreferencesSettings.getCodeGenerationSettings(javaProject);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ImportRewrite

    AST ast = astRewrite.getAST();

    String importName = Controller.class.getCanonicalName();
    if (!ProposalCalculatorUtil.containsImport(getCompilationUnit(), importName)) {
      ImportRewrite importRewrite = createImportRewrite(astRoot);
      importRewrite.addImport(importName);
    }

    MarkerAnnotation annotation = ast.newMarkerAnnotation();
    annotation.setTypeName(ast.newSimpleName("Controller"));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ImportRewrite

    AST ast = decl.getAST();
    ASTRewrite rewrite = ASTRewrite.create(ast);
    String qualifierTypeName = Qualifier.class.getCanonicalName();
    if (!ProposalCalculatorUtil.containsImport(getCompilationUnit(), qualifierTypeName)) {
      CompilationUnit astRoot = ASTResolving.findParentCompilationUnit(decl);
      ImportRewrite importRewrite = createImportRewrite(astRoot);
      importRewrite.addImport(qualifierTypeName);
    }

    SingleMemberAnnotation annotation = ast.newSingleMemberAnnotation();
    SimpleName typeName = ast.newSimpleName("Qualifier");
    StringLiteral beanValue = ast.newStringLiteral();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ImportRewrite

    CompilationUnit astRoot = ASTResolving.findParentCompilationUnit(decl);
    ASTRewrite astRewrite = ASTRewrite.create(astRoot.getAST());

    AST ast = astRewrite.getAST();

    ImportRewrite importRewrite = createImportRewrite(astRoot);
    if (params.length == 0) {
      createAnnotation(Autowired.class.getCanonicalName(), Autowired.class.getSimpleName(), astRoot, ast,
          astRewrite, importRewrite, false, null);
    }
    else {
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.