Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.modifiers()


                + methodDec.getName());
            tag.fragments().add(text);
            comment.tags().add(tag);
            type.setJavadoc(comment);
            type.setInterface(false);
            type.modifiers()
                .add(ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
            type.setName(ast.newSimpleName(className));
            type.bodyDeclarations().add(
                BodyDeclaration.copySubtree(type.getAST(),
                    methodDec));
View Full Code Here


    /*
     * build the new class using AST
     */
    TypeDeclaration newType = ast.newTypeDeclaration();
    newType.setInterface(node.isInterface());
    newType.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
    newType.setName(ast.newSimpleName(node.getName().getIdentifier()));
    newType.setSuperclassType(ast.newSimpleType(ast.newSimpleName(superTypeName)));
    /*
     * create the get and set methods only
     */
 
View Full Code Here

                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        setCheckpoint.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
        classDeclaration.bodyDeclarations().add(setCheckpoint);

        classDeclaration.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
        return classDeclaration;
    }

    /** Create a field that stores all the records as an array.
View Full Code Here

  public void removeClassAnnotation(String targetClass, Class<?> cls) {
    try {
      TypeDeclaration typeDeclaration = compilationUnitCache.getTypeDeclaration(targetClass);

      List modifiers = typeDeclaration.modifiers();
      Iterator iterator = modifiers.iterator();

      while (iterator.hasNext()) {
        IExtendedModifier modifier = (IExtendedModifier) iterator.next();
        if (modifier.isAnnotation()) {
View Full Code Here

  public TypeDeclaration generateClass(Classifier clazz, AST ast,
      CompilationUnit cu) {
    String className = getClassName(clazz);
    TypeDeclaration td = ast.newTypeDeclaration();
    td.setInterface(true);
    td.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
    td.setName(ast.newSimpleName(className));

    // Add inheritance
    generateClassInheritance(clazz, ast, td);
View Full Code Here

  public TypeDeclaration generateClass(Classifier clazz, AST ast,
      CompilationUnit cu) {
    String className = getClassName(clazz);
    TypeDeclaration td = ast.newTypeDeclaration();
    td.setInterface(false);
    td.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
    td.setName(ast.newSimpleName(className));

    // Add inheritance
    generateClassInheritance(clazz, ast, td);
View Full Code Here

    ast.newCompilationUnit();
    TypeDeclaration td = ast.newTypeDeclaration();
    td.setInterface(true);
    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));
    MethodDeclaration md = ast.newMethodDeclaration();
    md.setName(ast.newSimpleName("calculateAge"));

    Operation operation = mock(Operation.class,
View Full Code Here

    ast.newCompilationUnit();
    TypeDeclaration td = ast.newTypeDeclaration();
    td.setInterface(true);
    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));
    MethodDeclaration md = ast.newMethodDeclaration();
    md.setName(ast.newSimpleName("calculateAge"));

    Operation operation = mock(Operation.class,
View Full Code Here

    ast.newCompilationUnit();
    TypeDeclaration td = ast.newTypeDeclaration();
    td.setInterface(true);
    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));
    MethodDeclaration md = ast.newMethodDeclaration();
    md.setName(ast.newSimpleName("calculateAge"));

    Operation operation = mock(Operation.class,
View Full Code Here

    TypeDeclaration td = ast.newTypeDeclaration();
    td.setInterface(true);

    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));

    TypeDeclaration typeDeclaration = interfaceGenerator.generateClass(
        clazz, ast, cu);
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.