Package org.eclipse.jdt.core.dom

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


        List<IExtendedModifier> modifiers = typeDeclaration.modifiers();

        for (IExtendedModifier extendedModifier : modifiers) {
            if (extendedModifier.isAnnotation()) {
                if (extendedModifier instanceof MarkerAnnotation) {
                    MarkerAnnotation marker = (MarkerAnnotation)extendedModifier;
                    classMetadata.getAnnotations().add(AnnotationMetadata.markerAnnotation(JavaMetadataUtil.getName(marker.getTypeName())));
                }
            } else {
                Modifier modifier = (Modifier)extendedModifier;
                classMetadata.getModifiers().add(new ModifierMetadata(modifier.getKeyword().toString()));
            }
View Full Code Here


    }

    //
    // 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;
  }
View Full Code Here

          TypeDeclaration.BODY_DECLARATIONS_PROPERTY);
      MethodDeclaration md = ast.newMethodDeclaration();
      md.setName(ast.newSimpleName("factory" + capitalize(parameterMethod.getName().toString())));

      // Add the "Factory" annotation
      MarkerAnnotation factory = ast.newMarkerAnnotation();
      factory.setTypeName(ast.newName("Factory"));
      md.modifiers().add(factory);

      // Make the method public
      md.modifiers().addAll(ast.newModifiers(Modifier.PUBLIC | Modifier.STATIC));
      ArrayType returnType = ast.newArrayType(ast.newSimpleType(ast.newName("Object")));
View Full Code Here

    // Add a @Test annotation on all the public methods that don't already
    // have a TestNG annotation.
    //
    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

    AST ast = astRewrite.getAST();

    Annotation annotation;
    if (exceptionNames.isEmpty()) {
      MarkerAnnotation mAnnotation = ast.newMarkerAnnotation();
      annotation = mAnnotation;
    }
    else {
      SingleMemberAnnotation sAnnotation = ast.newSingleMemberAnnotation();
      annotation = sAnnotation;
View Full Code Here

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

    MarkerAnnotation annotation = ast.newMarkerAnnotation();
    annotation.setTypeName(ast.newSimpleName("ResponseBody"));

    astRewrite.getListRewrite(methodDecl, MethodDeclaration.MODIFIERS2_PROPERTY).insertLast(annotation, null);

    return astRewrite;
  }
View Full Code Here

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

    MarkerAnnotation annotation = ast.newMarkerAnnotation();
    annotation.setTypeName(ast.newSimpleName("Controller"));

    astRewrite.getListRewrite(typeDecl, TypeDeclaration.MODIFIERS2_PROPERTY).insertFirst(annotation, null);

    return astRewrite;
  }
View Full Code Here

      createImportRewrite(astRoot).addImport(importName);
    }

    AST ast = astRewrite.getAST();

    MarkerAnnotation annotation = ast.newMarkerAnnotation();
    SimpleName name = ast.newSimpleName("InitBinder");
    annotation.setTypeName(name);

    astRewrite.getListRewrite(methodDecl, MethodDeclaration.MODIFIERS2_PROPERTY).insertFirst(annotation, null);

    return astRewrite;
  }
View Full Code Here

TOP

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

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.