Examples of insertLast()


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

           ASTNode element = ((JavaElement) this.anchorElement).findNode(this.cuAST);
           if (childListPropertyDescriptor.getElementType().isAssignableFrom(element.getClass()))
             rewrite.insertBefore(child, element, null);
           else
             // case of an empty import list: the anchor element is the top level type and cannot be used in insertBefore as it is not the same type
             rewrite.insertLast(child, null);
           break;
         case INSERT_AFTER:
           element = ((JavaElement) this.anchorElement).findNode(this.cuAST);
           if (childListPropertyDescriptor.getElementType().isAssignableFrom(element.getClass()))
             rewrite.insertAfter(child, element, null);
View Full Code Here

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

           element = ((JavaElement) this.anchorElement).findNode(this.cuAST);
           if (childListPropertyDescriptor.getElementType().isAssignableFrom(element.getClass()))
             rewrite.insertAfter(child, element, null);
           else
             // case of an empty import list: the anchor element is the top level type and cannot be used in insertAfter as it is not the same type
             rewrite.insertLast(child, null);
           break;
         case INSERT_LAST:
           rewrite.insertLast(child, null);
           break;
       }
View Full Code Here

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

           else
             // case of an empty import list: the anchor element is the top level type and cannot be used in insertAfter as it is not the same type
             rewrite.insertLast(child, null);
           break;
         case INSERT_LAST:
           rewrite.insertLast(child, null);
           break;
       }
    } else {
      rewriter.set(parent, propertyDescriptor, child, null);
    }
View Full Code Here

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

        FieldDeclaration field = getFieldDeclaration(type, bug.getPrimaryField());

        Modifier finalModifier = workingUnit.getAST().newModifier(getModifierToAdd());

        ListRewrite modRewrite = rewrite.getListRewrite(field, FieldDeclaration.MODIFIERS2_PROPERTY);
        modRewrite.insertLast(finalModifier, null);
    }

    public abstract ModifierKeyword getModifierToAdd();

}
View Full Code Here

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

        Block methodBody = method.getBody();
        ListRewrite listRewrite = rewrite.getListRewrite(methodBody, Block.STATEMENTS_PROPERTY);
        if (isInsertFirst()) {
            listRewrite.insertFirst(statement, null);
        } else {
            listRewrite.insertLast(statement, null);
        }
    }

    protected SuperMethodInvocation createSuperMethodInvocation(ASTRewrite rewrite, MethodDeclaration method) {
        assert rewrite != null;
View Full Code Here

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

        for (Object paramObj : params) {
            SingleVariableDeclaration param = (SingleVariableDeclaration) paramObj;
            if (variables.contains(param.getName().getFullyQualifiedName())) {
                ListRewrite listRewrite = rewrite.getListRewrite(param, SingleVariableDeclaration.MODIFIERS2_PROPERTY);
                listRewrite.insertLast(rewrite.getAST().newModifier(ModifierKeyword.FINAL_KEYWORD), null);
            }
        }
    }

    protected void updateLocalVariableDeclarations(final ASTRewrite rewrite, final Set<String> variables, Block block) {
View Full Code Here

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

                if (variables.contains(fragment.getName().getFullyQualifiedName())) {
                    ASTNode parent = fragment.getParent();
                    if (parent instanceof VariableDeclarationStatement) {
                        ListRewrite listRewrite = rewrite
                                .getListRewrite(parent, VariableDeclarationStatement.MODIFIERS2_PROPERTY);
                        listRewrite.insertLast(ast.newModifier(ModifierKeyword.FINAL_KEYWORD), null);
                    }
                }
                return true;
            }
View Full Code Here

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

        TypeDeclaration type = getTypeDeclaration(workingUnit, bug.getPrimaryClass());
        Modifier finalMod = workingUnit.getAST().newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD);

        ListRewrite modRewrite = rewrite.getListRewrite(type, TypeDeclaration.MODIFIERS2_PROPERTY);
        modRewrite.insertLast(finalMod, null);
    }

}
View Full Code Here

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

      for(Object body:bodyDeclarations){
        MethodDeclaration methodDec = (MethodDeclaration) body;
        ListRewrite listRewrite = rewriter.getListRewrite(methodDec.getJavadoc(), Javadoc.TAGS_PROPERTY);
        List originalList = listRewrite.getOriginalList();
        ASTNode node = createNode(cu.getAST());
        listRewrite.insertLast(node, null);
        System.out.println(originalList);
        System.out.println(listRewrite.getRewrittenList());
      }
    }
    TextEdit rewriteAst = rewriter.rewriteAST(doc, null);
View Full Code Here

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

        for(String memberName: newMembers) {
            Object value = newMemberValues.get(memberName);
            if (value != null) {
                MemberValuePair newValuePair = createMemberValuePair(ast, memberName, value);
                // TODO: should attempt to preserve order
                listRewrite.insertLast(newValuePair, null);
            } else {
                // nothing to do
            }
        }
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.