KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > java > source > TreeMaker


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.api.java.source;
20
21 import com.sun.source.tree.*;
22 import com.sun.source.tree.Tree.Kind;
23 import com.sun.source.util.SourcePositions;
24 import com.sun.source.util.TreePath;
25
26 import javax.lang.model.element.*;
27 import javax.lang.model.type.*;
28 import javax.tools.JavaFileObject;
29
30 import java.util.List JavaDoc;
31 import java.util.Set JavaDoc;
32 import java.util.EnumSet JavaDoc;
33
34 import org.netbeans.api.java.source.query.CommentHandler;
35 import org.netbeans.api.java.source.query.CommentSet;
36 import org.netbeans.api.java.lexer.JavaTokenId;
37 import org.netbeans.api.java.source.Comment.Style;
38 import org.netbeans.api.java.source.query.CommentHandler;
39 import org.netbeans.api.java.source.query.Query;
40 import org.netbeans.api.lexer.TokenHierarchy;
41 import org.netbeans.api.lexer.TokenSequence;
42 import org.netbeans.modules.java.source.JavaSourceAccessor;
43
44 import org.netbeans.modules.java.source.engine.TreeMakerInt;
45 import org.netbeans.modules.java.source.builder.CommentHandlerService;
46
47 /**
48  * Factory interface for creating new com.sun.source.tree instances. The
49  * parameters for each method correspond as closely as possible to the
50  * accessor methods for each tree interface.<br>
51  *
52  * You can obtain appropriate instance of this class by getting it from working
53  * copy:
54  *
55  * <pre>
56  * CancellableTask task = new CancellableTask<WorkingCopy>() {
57  *
58  * public void run(WorkingCopy workingCopy) throws Exception {
59  * <b>TreeMaker make = workingCopy.getTreeMaker()</b>;
60  * ... your modification code here
61  * }
62  * ...
63  * };
64  * </pre>
65  *
66  * @see <a HREF="http://wiki.netbeans.org/wiki/view/JavaHT_Modification">How do I do modification to a source file?</a>
67  *
68  * @author Tom Ball
69  * @author Pavel Flaska
70  */

71 public final class TreeMaker {
72     
73     private TreeMakerInt delegate;
74     private CommentHandler handler;
75     private WorkingCopy copy;
76     
77     TreeMaker(WorkingCopy copy, TreeMakerInt delegate) {
78         this.delegate = delegate;
79         this.copy = copy;
80         this.handler = CommentHandlerService.instance(copy.getJavacTask().getContext());
81     }
82     
83     /**
84      * Creates a new AnnotationTree.
85      *
86      * @param type the annotation type.
87      * @param arguments the arguments for this annotation, or an empty list.
88      * @see com.sun.source.tree.AnnotationTree
89      */

90     public AnnotationTree Annotation(Tree type, List JavaDoc<? extends ExpressionTree> arguments) {
91         return delegate.Annotation(type, arguments);
92     }
93     
94     /**
95      * Creates a new ArrayAccessTree.
96      *
97      * @param array the array expression.
98      * @param index the array index.
99      * @see com.sun.source.tree.ArrayAccessTree
100      */

101     public ArrayAccessTree ArrayAccess(ExpressionTree array, ExpressionTree index) {
102         return delegate.ArrayAccess(array, index);
103     }
104     
105     /**
106      * Creates a new ArrayTypeTree.
107      *
108      * @param type the array type.
109      * @see com.sun.source.tree.ArrayTypeTree
110      */

111     public ArrayTypeTree ArrayType(Tree type) {
112         return delegate.ArrayType(type);
113     }
114     
115     /**
116      * Creates a new AssertTree.
117      *
118      * @param condition the boolean expression to test.
119      * @param detail the detail message to include if the assertion fails.
120      * @see com.sun.source.tree.AssertTree
121      */

122     public AssertTree Assert(ExpressionTree condition, ExpressionTree detail) {
123         return delegate.Assert(condition, detail);
124     }
125     
126     /**
127      * Creates a new AssignmentTree.
128      *
129      * @param variable the variable the expression is assigned to.
130      * @param expression the expression to assign to the variable.
131      * @see com.sun.source.tree.AssignmentTree
132      */

133     public AssignmentTree Assignment(ExpressionTree variable, ExpressionTree expression) {
134         return delegate.Assignment(variable, expression);
135     }
136
137     /**
138      * Creates a new BinaryTree.
139      *
140      * @param operator the operator for this tree, such as Tree.Kind.PLUS.
141      * @param left the left operand of the tree.
142      * @param right the right operand of the tree.
143      * @see com.sun.source.tree.BinaryTree
144      * @see com.sun.source.tree.Tree.Kind
145      */

146     public BinaryTree Binary(Kind operator, ExpressionTree left, ExpressionTree right) {
147         return delegate.Binary(operator, left, right);
148     }
149
150     /**
151      * Creates a new BlockTree.
152      *
153      * @param statements the list of statements to be contained within the block.
154      * @param isStatic true if the block defines a static initializer for a class. ExpressionTree getCondition();
155     ExpressionTree getDetail();
156
157      * @see com.sun.source.tree.BlockTree
158      */

159     public BlockTree Block(List JavaDoc<? extends StatementTree> statements, boolean isStatic) {
160         return delegate.Block(statements, isStatic);
161     }
162     
163     /**
164      * Creates a new BreakTree.
165      *
166      * @param label the label to break to, or null if there is no label.
167      * @see com.sun.source.tree.BreakTree
168      */

169     public BreakTree Break(CharSequence JavaDoc label) {
170         return delegate.Break(label);
171     }
172     
173     /**
174      * Creates a new CaseTree.
175      *
176      * @param expression the label for this case statement.
177      * @param statements the list of statements.
178      * @see com.sun.source.tree.CaseTree
179      */

180     public CaseTree Case(ExpressionTree expression, List JavaDoc<? extends StatementTree> statements) {
181         return delegate.Case(expression, statements);
182     }
183     
184     /**
185      * Creates a new CatchTree.
186      *
187      * @param parameter the exception variable declaration.
188      * @param block the block of statements executed by this catch statement.
189      * @see com.sun.source.tree.CatchTree
190      */

191     public CatchTree Catch(VariableTree parameter, BlockTree block) {
192         return delegate.Catch(parameter, block);
193     }
194     
195     /**
196      * Creates a new ClassTree.
197      *
198      * @param modifiers the modifiers declaration
199      * @param simpleName the name of the class without its package, such
200      * as "String" for the class "java.lang.String".
201      * @param typeParameters the list of type parameters, or an empty list.
202      * @param extendsClause the name of the class this class extends, or null.
203      * @param implementsClauses the list of the interfaces this class
204      * implements, or an empty list.
205      * @param memberDecls the list of fields defined by this class, or an
206      * empty list.
207      * @see com.sun.source.tree.ClassTree
208      */

209     public ClassTree Class(ModifiersTree modifiers,
210               CharSequence JavaDoc simpleName,
211               List JavaDoc<? extends TypeParameterTree> typeParameters,
212               Tree extendsClause,
213               List JavaDoc<? extends ExpressionTree> implementsClauses,
214               List JavaDoc<? extends Tree> memberDecls) {
215         return delegate.Class(modifiers, simpleName, typeParameters, extendsClause, implementsClauses, memberDecls);
216     }
217     /**
218      * Creates a new ClassTree representing interface.
219      *
220      * @param modifiers the modifiers declaration
221      * @param simpleName the name of the class without its package, such
222      * as "String" for the class "java.lang.String".
223      * @param typeParameters the list of type parameters, or an empty list.
224      * @param extendsClauses the list of the interfaces this class
225      * extends, or an empty list.
226      * @param memberDecls the list of fields defined by this class, or an
227      * empty list.
228      * @see com.sun.source.tree.ClassTree
229      */

230     public ClassTree Interface(ModifiersTree modifiers,
231              CharSequence JavaDoc simpleName,
232              List JavaDoc<? extends TypeParameterTree> typeParameters,
233              List JavaDoc<? extends ExpressionTree> extendsClauses,
234              List JavaDoc<? extends Tree> memberDecls) {
235         return delegate.Interface(modifiers, simpleName, typeParameters, extendsClauses, memberDecls);
236     }
237     
238     /**
239      * Creates a new ClassTree representing annotation type.
240      *
241      * @param modifiers the modifiers declaration
242      * @param simpleName the name of the class without its package, such
243      * as "String" for the class "java.lang.String".
244      * @param memberDecls the list of fields defined by this class, or an
245      * empty list.
246      * @see com.sun.source.tree.ClassTree
247      */

248     public ClassTree AnnotationType(ModifiersTree modifiers,
249              CharSequence JavaDoc simpleName,
250              List JavaDoc<? extends Tree> memberDecls) {
251         return delegate.AnnotationType(modifiers, simpleName, memberDecls);
252     }
253     
254     /**
255      * Creates a new ClassTree representing enum.
256      *
257      * @param modifiers the modifiers declaration
258      * @param simpleName the name of the class without its package, such
259      * as "String" for the class "java.lang.String".
260      * @param implementsClauses the list of the interfaces this class
261      * implements, or an empty list.
262      * @param memberDecls the list of fields defined by this class, or an
263      * empty list.
264      * @see com.sun.source.tree.ClassTree
265      */

266     public ClassTree Enum(ModifiersTree modifiers,
267              CharSequence JavaDoc simpleName,
268              List JavaDoc<? extends ExpressionTree> implementsClauses,
269              List JavaDoc<? extends Tree> memberDecls) {
270         return delegate.Enum(modifiers, simpleName, implementsClauses, memberDecls);
271     }
272     
273     /**
274      * Creates a new CompilationUnitTree.
275      *
276      * @param packageName a tree representing the package name.
277      * @param imports a list of import statements.
278      * @param typeDeclarations a list of type (class, interface or enum) declarations.
279      * @param sourceFile the source file associated with this compilation unit.
280      * @see com.sun.source.tree.CompilationUnitTree
281      */

282     public CompilationUnitTree CompilationUnit(ExpressionTree packageName,
283                                         List JavaDoc<? extends ImportTree> imports,
284                                         List JavaDoc<? extends Tree> typeDeclarations,
285                                         JavaFileObject sourceFile) {
286         return delegate.CompilationUnit(packageName, imports, typeDeclarations, sourceFile);
287     }
288      
289     /**
290      * Creates a new CompoundAssignmentTree.
291      *
292      * @param operator the operator for this tree, such as Tree.Kind.PLUS_ASSIGNMENT.
293      * @param variable the variable the expression is assigned to.
294      * @param expression the expression to assign to the variable.
295      * @see com.sun.source.tree.CompoundAssignmentTree
296      */

297     public CompoundAssignmentTree CompoundAssignment(Kind operator,
298                                               ExpressionTree variable,
299                                               ExpressionTree expression) {
300         return delegate.CompoundAssignment(operator, variable, expression);
301     }
302    
303     /**
304      * Creates a new ConditionalExpressionTree.
305      *
306      * @param condition the boolean expression to test.
307      * @param trueExpression the expression to be executed when the
308      * condition is true.
309      * @param falseExpression the expression to be executed when the
310      * condition is false.
311      * @see com.sun.source.tree.ConditionalExpressionTree
312      */

313     public ConditionalExpressionTree ConditionalExpression(ExpressionTree condition,
314                                                     ExpressionTree trueExpression,
315                                                     ExpressionTree falseExpression) {
316         return delegate.ConditionalExpression(condition, trueExpression, falseExpression);
317     }
318
319     /**
320      * Creates a new MethodTree representing constructor.
321      *
322      * @param modifiers the modifiers of this method.
323      * @param typeParameters the list of generic type parameters, or an empty list.
324      * @param parameters the list of parameters, or an empty list.
325      * @param throwsList the list of throws clauses, or an empty list.
326      * @param body the method's code block.
327      * @see com.sun.source.tree.MethodTree
328      */

329     public MethodTree Constructor(ModifiersTree modifiers,
330                              List JavaDoc<? extends TypeParameterTree> typeParameters,
331                              List JavaDoc<? extends VariableTree> parameters,
332                              List JavaDoc<? extends ExpressionTree> throwsList,
333                              BlockTree body) {
334         return delegate.Method(modifiers, "<init>", null, typeParameters, parameters, throwsList, body, null);
335     }
336     
337     /**
338      * Creates a new MethodTree representing constructor.
339      *
340      * @param modifiers the modifiers of this method.
341      * @param typeParameters the list of generic type parameters, or an empty list.
342      * @param parameters the list of parameters, or an empty list.
343      * @param throwsList the list of throws clauses, or an empty list.
344      * @param bodyText the method's code block provided as a plain text
345      * @see com.sun.source.tree.MethodTree
346      */

347     public MethodTree Constructor(ModifiersTree modifiers,
348                              List JavaDoc<? extends TypeParameterTree> typeParameters,
349                              List JavaDoc<? extends VariableTree> parameters,
350                              List JavaDoc<? extends ExpressionTree> throwsList,
351                              String JavaDoc bodyText) {
352         return Method(modifiers, "<init>", null, typeParameters, parameters, throwsList, bodyText, null);
353     }
354     
355     /**
356      * Creates a new ContinueTree.
357      *
358      * @param label the label to break to, or null if there is no label.
359      * @see com.sun.source.tree.ContinueTree
360      */

361     public ContinueTree Continue(CharSequence JavaDoc label) {
362         return delegate.Continue(label);
363     }
364     
365     /** Creates a new DoWhileLoopTree.
366      *
367      * @param condition the boolean expression to test.
368      * @param statement the statement to execute while the condition is true.
369      * @see com.sun.source.tree.DoWhileLoopTree
370      */

371     public DoWhileLoopTree DoWhileLoop(ExpressionTree condition, StatementTree statement) {
372         return delegate.DoWhileLoop(condition, statement);
373     }
374
375     /**
376      * Creates a new EmptyStatementTree.
377      *
378      * @see com.sun.source.tree.EmptyStatementTree
379      */

380     public EmptyStatementTree EmptyStatement() {
381         return delegate.EmptyStatement();
382     }
383     
384     /**
385      * Creates a new EnhancedForLoopTree.
386      *
387      * @param variable the loop variable declaration.
388      * @param expression the expression to be iterated.
389      * @param statement the statement to execute each iteration.
390      * @see com.sun.source.tree.EnhancedForLoopTree
391      */

392     public EnhancedForLoopTree EnhancedForLoop(VariableTree variable,
393                                         ExpressionTree expression,
394                                         StatementTree statement) {
395         return delegate.EnhancedForLoop(variable, expression, statement);
396     }
397     
398     /**
399      * Creates a new ErroneousTree.
400      *
401      * @param errorTrees a list of trees with possible errors.
402      * @see com.sun.source.tree.ErroneousTree
403      */

404     public ErroneousTree Erroneous(List JavaDoc<? extends Tree> errorTrees) {
405         return delegate.Erroneous(errorTrees);
406     }
407     
408     /**
409      * Creates a new ExpressionStatementTree.
410      *
411      * @param expression the expression body for this statement.
412      * @see com.sun.source.tree.ExpressionStatementTree
413      */

414     public ExpressionStatementTree ExpressionStatement(ExpressionTree expression) {
415         return delegate.ExpressionStatement(expression);
416     }
417     
418     /**
419      * Creates a new ForLoopTree.
420      *
421      * @param initializer a list of initializer statements, or an empty list.
422      * @param condition the condition to evaluate after each iteration.
423      * @param update the statements to execute after each iteration.
424      * @param statement the statement to execute for each iteration.
425      * @see com.sun.source.tree.ForLoopTree
426      */

427     public ForLoopTree ForLoop(List JavaDoc<? extends StatementTree> initializer,
428                         ExpressionTree condition,
429                         List JavaDoc<? extends ExpressionStatementTree> update,
430                         StatementTree statement) {
431         return delegate.ForLoop(initializer, condition, update, statement);
432     }
433     
434     /**
435      * Creates a new IdentifierTree.
436      *
437      * @param name the name of the identifier.
438      * @see com.sun.source.tree.IdentifierTree
439      */

440     public IdentifierTree Identifier(CharSequence JavaDoc name) {
441         return delegate.Identifier(name);
442     }
443     
444     /**
445      * Creates a new IdentifierTree from an Element.
446      *
447      * @param element the element from which to extract the identifier name.
448      * @see com.sun.source.tree.IdentifierTree
449      * @see javax.lang.model.element.Element
450      */

451     public IdentifierTree Identifier(Element element) {
452         return delegate.Identifier(element);
453     }
454      
455     
456     /** Creates a new IfTree.
457      *
458      * @param condition the boolean expression to test.
459      * @param thenStatement the statement to execute if the condition is true.
460      * @param elseStatement the statement to execute if the condition if false.
461      * A null value should be used if there is no else
462      * statement.
463      * @see com.sun.source.tree.IfTree
464      */

465     public IfTree If(ExpressionTree condition, StatementTree thenStatement, StatementTree elseStatement) {
466         return delegate.If(condition, thenStatement, elseStatement);
467     }
468     
469     /**
470      * Creates a new ImportTree.
471      *
472      * @param qualid fully qualified identifier.
473      * @param importStatic true if static import statement.
474      * @see com.sun.source.tree.ImportTree
475      */

476     public ImportTree Import(Tree qualid, boolean importStatic) {
477         return delegate.Import(qualid, importStatic);
478     }
479     
480     /**
481      * Creates a new InstanceOfTree.
482      *
483      * @param expression the expression whose type is being checked.
484      * @param type the type to compare to.
485      * @see com.sun.source.tree.InstanceOfTree
486      */

487     public InstanceOfTree InstanceOf(ExpressionTree expression, Tree type) {
488         return delegate.InstanceOf(expression, type);
489     }
490     
491     /**
492      * Creates a new LabeledStatementTree.
493      *
494      * @param label the label string.
495      * @param statement the statement being labeled.
496      * @see com.sun.source.tree.LabeledStatementTree
497      */

498     public LabeledStatementTree LabeledStatement(CharSequence JavaDoc label, StatementTree statement) {
499         return delegate.LabeledStatement(label, statement);
500     }
501     
502     /**
503      * Creates a new LiteralTree. Only literals which are wrappers for
504      * primitive types (Integer, Boolean, etc.) and String instances can
505      * be literals.
506      *
507      * @param value the value of the literal.
508      * @throws IllegalArgumentException for illegal literal values.
509      * @see com.sun.source.tree.LiteralTree
510      */

511     public LiteralTree Literal(Object JavaDoc value) {
512         return delegate.Literal(value);
513     }
514     
515     /**
516      * Creates a new MemberSelectTree. A MemberSelectTree consists of an
517      * expression and an identifier. Valid expressions include things like
518      * packages, class and field references, etc., while the identifier is a
519      * "child" of the expression. For example, "System.out" is represented by
520      * MemberSelectTree which has an ExpressionTree representing "System" and
521      * an identifier of "out".
522      *
523      * @param expression the expression the identifier is part of.
524      * @param identifier the element to select.
525      * @see com.sun.source.tree.MemberSelectTree
526      */

527     public MemberSelectTree MemberSelect(ExpressionTree expression, CharSequence JavaDoc identifier) {
528         return delegate.MemberSelect(expression, identifier);
529     }
530
531     /**
532      * Creates a new MemberSelectTree from an expression and an element.
533      *
534      * @param expression the expression the identifier is part of.
535      * @param element the element that provides the identifier name.
536      * @see com.sun.source.tree.MemberSelectTree
537      * @see javax.lang.model.element.Element
538      */

539     public MemberSelectTree MemberSelect(ExpressionTree expression, Element element) {
540         return delegate.MemberSelect(expression, element);
541     }
542     
543     /**
544      * Creates a new MethodInvocationTree.
545      *
546      * @param typeArguments the list of generic type arguments, or an empty list.
547      * @param method the method to be invoked.
548      * @param arguments the list of arguments to pass to the method, or an empty list.
549      * @see com.sun.source.tree.MethodInvocationTree
550      */

551     public MethodInvocationTree MethodInvocation(List JavaDoc<? extends ExpressionTree> typeArguments,
552                                           ExpressionTree method,
553                                           List JavaDoc<? extends ExpressionTree> arguments) {
554         return delegate.MethodInvocation(typeArguments, method, arguments);
555     }
556     
557     /**
558      * Creates a new MethodTree.
559      *
560      * @param modifiers the modifiers of this method.
561      * @param name the name of the method.
562      * @param returnType the return type for this method.
563      * @param typeParameters the list of generic type parameters, or an empty list.
564      * @param parameters the list of parameters, or an empty list.
565      * @param throwsList the list of throws clauses, or an empty list.
566      * @param body the method's code block.
567      * @param defaultValue the default value, used by annotation types.
568      * @see com.sun.source.tree.MethodTree
569      */

570     public MethodTree Method(ModifiersTree modifiers,
571                       CharSequence JavaDoc name,
572                       Tree returnType,
573                       List JavaDoc<? extends TypeParameterTree> typeParameters,
574                       List JavaDoc<? extends VariableTree> parameters,
575                       List JavaDoc<? extends ExpressionTree> throwsList,
576                       BlockTree body,
577                       ExpressionTree defaultValue) {
578         return delegate.Method(modifiers, name, returnType, typeParameters, parameters, throwsList, body, defaultValue);
579     }
580     
581     /**
582      * Creates a new MethodTree.
583      *
584      * @param modifiers the modifiers of this method.
585      * @param name the name of the method.
586      * @param returnType the return type for this method.
587      * @param typeParameters the list of generic type parameters, or an empty list.
588      * @param parameters the list of parameters, or an empty list.
589      * @param throwsList the list of throws clauses, or an empty list.
590      * @param body the method's code block.
591      * @param defaultValue the default value, used by annotation types.
592      * @param enclosingElement the type instance this method is a member of.
593      * @see com.sun.source.tree.MethodTree
594      */

595     public MethodTree Method(ModifiersTree modifiers,
596                       CharSequence JavaDoc name,
597                       Tree returnType,
598                       List JavaDoc<? extends TypeParameterTree> typeParameters,
599                       List JavaDoc<? extends VariableTree> parameters,
600                       List JavaDoc<? extends ExpressionTree> throwsList,
601                       BlockTree body,
602                       ExpressionTree defaultValue,
603                       TypeElement enclosingElement) {
604         return delegate.Method(modifiers, name, returnType, typeParameters, parameters, throwsList, body, defaultValue, enclosingElement);
605     }
606     
607     /**
608      * Creates a new MethodTree from an ExecutableElement and a BlockTree.
609      *
610      * @param element the executable element of this method.
611      * @param body the method's code block, or null for native, abstract,
612      * and interface methods.
613      * @see com.sun.source.tree.MethodTree
614      * @see javax.lang.model.element.ExecutableElement
615      */

616     public MethodTree Method(ExecutableElement element, BlockTree body) {
617         return delegate.Method(element, body);
618     }
619     
620     /**
621      * Creates a new ModifiersTree with a new set of flags and annotations.
622      *
623      * @param flags the set of modifier flags
624      * @param annotations a list of annotations, or an empty list.
625      * @see com.sun.source.tree.ModifiersTree
626      * @see javax.lang.model.element.Modifier
627      */

628     public ModifiersTree Modifiers(Set JavaDoc<Modifier> flags, List JavaDoc<? extends AnnotationTree> annotations) {
629         return delegate.Modifiers(flags, annotations);
630     }
631     
632     /**
633      * Creates a new ModifiersTree with a new flags and annotation.
634      *
635      * @param flags modifier flags
636      * @see com.sun.source.tree.ModifiersTree
637      */

638     public ModifiersTree Modifiers(long flags, List JavaDoc<? extends AnnotationTree> annotations) {
639         return delegate.Modifiers(flags, annotations);
640     }
641     
642     /**
643      * Creates a new ModifiersTree without any annotations specified.
644      *
645      * @param flags the set of modifier flags
646      * @see com.sun.source.tree.ModifiersTree
647      * @see javax.lang.model.element.Modifier
648      */

649     public ModifiersTree Modifiers(Set JavaDoc<Modifier> flags) {
650         return delegate.Modifiers(flags);
651     }
652     
653     /**
654      * Creates a new ModifiersTree with a new set of annotations. The existing
655      * flags are copied from the old tree; this preserves private javac flags.
656      *
657      * @param oldMods the old ModifiersTree, from which the flags are copied.
658      * @param annotations a list of annotations, or an empty list.
659      * @see com.sun.source.tree.ModifiersTree
660      * @see javax.lang.model.element.Modifier
661      */

662     public ModifiersTree Modifiers(ModifiersTree oldMods, List JavaDoc<? extends AnnotationTree> annotations) {
663         return delegate.Modifiers(oldMods, annotations);
664     }
665     
666     /**
667      * Creates a new NewArrayTree.
668      *
669      * @param elemtype the element type.
670      * @param dimensions the list of array dimensions.
671      * @param initializers the list of initializer statements, or an empty list.
672      * @see com.sun.source.tree.NewArrayTree
673      */

674     public NewArrayTree NewArray(Tree elemtype,
675                           List JavaDoc<? extends ExpressionTree> dimensions,
676                           List JavaDoc<? extends ExpressionTree> initializers) {
677         return delegate.NewArray(elemtype, dimensions, initializers);
678     }
679
680     /**
681      * Creates a new NewClassTree.
682      *
683      * @param enclosingExpression the enclosing expression, or null.
684      * @param typeArguments the list of generic type arguments, or an empty list.
685      * @param identifier the class name expression
686      * @param arguments the list of constructor arguments, or an empty list.
687      * @param classBody the class definition, or null if there is no definition.
688      * @see com.sun.source.tree.NewClassTree
689      */

690     public NewClassTree NewClass(ExpressionTree enclosingExpression,
691                           List JavaDoc<? extends ExpressionTree> typeArguments,
692                           ExpressionTree identifier,
693                           List JavaDoc<? extends ExpressionTree> arguments,
694                           ClassTree classBody) {
695         return delegate.NewClass(enclosingExpression, typeArguments, identifier, arguments, classBody);
696     }
697     
698     /**
699      * Creates a new ParameterizedTypeTree.
700      *
701      * @param type the generic type
702      * @param typeArguments the list of generic type arguments, or an empty list.
703      * @see com.sun.source.tree.ParameterizedTypeTree
704      */

705     public ParameterizedTypeTree ParameterizedType(Tree type,
706                                             List JavaDoc<? extends ExpressionTree> typeArguments) {
707         return delegate.ParameterizedType(type, typeArguments);
708     }
709     
710     /**
711      * Creates a new ParenthesizedTree.
712      *
713      * @param expression the expression within the parentheses.
714      * @see com.sun.source.tree.ParenthesizedTree
715      */

716     public ParenthesizedTree Parenthesized(ExpressionTree expression) {
717         return delegate.Parenthesized(expression);
718     }
719     
720     /**
721      * Creates a new PrimitiveTypeTree.
722      *
723      * @param typekind the primitive type.
724      * @see com.sun.source.tree.PrimitiveTypeTree
725      * @see javax.lang.model.type.TypeKind
726      */

727     public PrimitiveTypeTree PrimitiveType(TypeKind typekind) {
728         return delegate.PrimitiveType(typekind);
729     }
730     
731     /**
732      * Creates a qualified identifier from an element.
733      *
734      * @param element the element to use.
735      */

736     public ExpressionTree QualIdent(Element element) {
737         return delegate.QualIdent(element);
738     }
739     
740     /**
741      * Creates a new ReturnTree.
742      *
743      * @param expression the expression to be returned.
744      * @see com.sun.source.tree.ReturnTree
745      */

746     public ReturnTree Return(ExpressionTree expression) {
747         return delegate.Return(expression);
748     }
749     
750     /**
751      * Creates a new SwitchTree.
752      *
753      * @param expression the expression which provides the value to be switched.
754      * @param cases the list of cases, or an empty list.
755      * @see com.sun.source.tree.SwitchTree
756      */

757     public SwitchTree Switch(ExpressionTree expression, List JavaDoc<? extends CaseTree> cases) {
758         return delegate.Switch(expression, cases);
759     }
760     
761     /**
762      * Creates a new SynchronizedTree.
763      *
764      * @param expression the expression defining the object being synchronized.
765      * @param block the block of statements executed by this statement.
766      * @see com.sun.source.tree.SynchronizedTree
767      */

768     public SynchronizedTree Synchronized(ExpressionTree expression, BlockTree block) {
769         return delegate.Synchronized(expression, block);
770     }
771     
772     /**
773      * Creates a new ThrowTree.
774      *
775      * @param expression the exception to be thrown.
776      * @see com.sun.source.tree.ThrowTree
777      */

778     public ThrowTree Throw(ExpressionTree expression) {
779         return delegate.Throw(expression);
780     }
781     
782     /**
783      * Creates a new TryTree.
784      *
785      * @param tryBlock the statement block in the try clause.
786      * @param catches the list of catch clauses, or an empty list.
787      * @param finallyBlock the finally clause, or null.
788      * @see com.sun.source.tree.TryTree
789      */

790     public TryTree Try(BlockTree tryBlock,
791                 List JavaDoc<? extends CatchTree> catches,
792                 BlockTree finallyBlock) {
793         return delegate.Try(tryBlock, catches, finallyBlock);
794     }
795     
796     /**
797      * Creates a new Tree for a given TypeMirror.
798      *
799      * @param type TypeMirror for which a Tree should be created
800      * @see com.sun.source.tree.ExpressionTree
801      */

802     public Tree Type(TypeMirror type) {
803         return delegate.Type(type);
804     }
805
806     /**
807      * Creates a new TypeCastTree.
808      *
809      * @param type the class or interface to cast.
810      * @param expression the expression being cast.
811      * @see com.sun.source.tree.TypeCastTree
812      */

813     public TypeCastTree TypeCast(Tree type, ExpressionTree expression) {
814         return delegate.TypeCast(type, expression);
815     }
816     
817     /**
818      * Creates a new TypeParameterTree.
819      *
820      * @param name the name of this type parameter.
821      * @param bounds the bounds of this parameter.
822      * @see com.sun.source.tree.TypeParameterTree
823      */

824     public TypeParameterTree TypeParameter(CharSequence JavaDoc name,
825                                     List JavaDoc<? extends ExpressionTree> bounds) {
826         return delegate.TypeParameter(name, bounds);
827     }
828
829     /**
830      * Creates a new UnaryTree.
831      *
832      * @param operator the operator for this tree, such as Tree.Kind.PLUS.
833      * @param arg the operand of the tree.
834      * @see com.sun.source.tree.UnaryTree
835      * @see com.sun.source.tree.Tree.Kind
836      */

837     public UnaryTree Unary(Kind operator, ExpressionTree arg) {
838         return delegate.Unary(operator, arg);
839     }
840     
841     /**
842      * Creates a new VariableTree.
843      *
844      * @param modifiers the modifiers of this variable.
845      * @param name the name of the variable.
846      * @param type the type of this variable.
847      * @param initializer the initialization expression for this variable, or null.
848      * @see com.sun.source.tree.VariableTree
849      */

850     public VariableTree Variable(ModifiersTree modifiers,
851                           CharSequence JavaDoc name,
852                           Tree type,
853                           ExpressionTree initializer) {
854         return delegate.Variable(modifiers, name, type, initializer);
855     }
856     
857     /**
858      * Creates a new VariableTree.
859      *
860      * @param modifiers the modifiers of this variable.
861      * @param name the name of the variable.
862      * @param type the type of this variable.
863      * @param initializer the initialization expression for this variable, or null.
864      * @param enclosingElement the type instance this variable is a member of.
865      * @see com.sun.source.tree.VariableTree
866      */

867     public VariableTree Variable(ModifiersTree modifiers,
868                           CharSequence JavaDoc name,
869                           Tree type,
870                           ExpressionTree initializer,
871                           TypeElement enclosingElement) {
872         return delegate.Variable(modifiers, name, type, initializer, enclosingElement);
873     }
874     
875     /**
876      * Creates a new VariableTree from a VariableElement.
877      *
878      * @param variable the VariableElement to reference.
879      * @param initializer the initialization expression, or null.
880      * @see com.sun.source.tree.VariableTree
881      * @see javax.lang.model.element.VariableElement
882      */

883     public VariableTree Variable(VariableElement variable, ExpressionTree initializer) {
884         return delegate.Variable(variable, initializer);
885     }
886     
887     /**
888      * Creates a new WhileLoopTree.
889      *
890      * @param condition the boolean expression to test.
891      * @param statement the statement to execute while the condition is true.
892      * @see com.sun.source.tree.WhileLoopTree
893      */

894     public WhileLoopTree WhileLoop(ExpressionTree condition, StatementTree statement) {
895         return delegate.WhileLoop(condition, statement);
896     }
897     
898     /**
899      * Creates a new WildcardTree.
900      *
901      * @param kind the kind of wildcard to create.
902      * @param type the type (class, interface or enum) of this wildcard.
903      * @see com.sun.source.tree.WildcardTree
904      */

905     public WildcardTree Wildcard(Kind kind, Tree type) {
906         return delegate.Wildcard(kind, type);
907     }
908     
909     ////////////////////////////////////////////////////////////////////////////
910
// AnnotationTree
911
/**
912      * Appends specified element <tt>attrValue</tt> to the end of attribute
913      * values list.
914      *
915      * @param annotation annotation tree containing attribute values list.
916      * @param attrValue element to be appended to attribute values list.
917      * @return annotation tree with modified attribute values.
918      */

919     public AnnotationTree addAnnotationAttrValue(AnnotationTree annotation, ExpressionTree attrValue) {
920         return delegate.addAnnotationAttrValue(annotation, attrValue);
921     }
922     
923     /**
924      * Inserts the specified element <tt>attrValue</tt> at the specified
925      * position in attribute values list.
926      *
927      * @param annotation annotation tree with attribute values list.
928      * @param index index at which the specified element is to be inserted.
929      * @param attrValue element to be inserted to attribute values list.
930      * @return annotation tree with modified attribute values.
931      *
932      * @throws IndexOutOfBoundsException if the index is out of range
933      * (index &lt; 0 || index &gt; size()).
934      */

935     public AnnotationTree insertAnnotationAttrValue(AnnotationTree annotation, int index, ExpressionTree attrValue) {
936         return delegate.insertAnnotationAttrValue(annotation, index, attrValue);
937     }
938     
939     /**
940      * Removes the first occurrence in attribute values list of the specified
941      * element. If this list does not contain the element, it is
942      * unchanged.
943      *
944      * @param annotation annotation tree with attribute values list.
945      * @param attrValue element to be removed from this list, if present.
946      * @return annotation tree with modified attribute values.
947      */

948     public AnnotationTree removeAnnotationAttrValue(AnnotationTree annotation, ExpressionTree attrValue) {
949         return delegate.removeAnnotationAttrValue(annotation, attrValue);
950     }
951     
952     /**
953      * Removes the element at the specified position in attribute values list.
954      * Returns the modified annotation tree.
955      *
956      * @param annotation annotation tree with attribute values list.
957      * @param index the index of the element to be removed.
958      * @return annotation tree with modified attribute values.
959      *
960      * @throws IndexOutOfBoundsException if the index is out of range
961      * (index &lt; 0 || index &gt;= size()).
962      */

963     public AnnotationTree removeAnnotationAttrValue(AnnotationTree annotation, int index) {
964         return delegate.removeAnnotationAttrValue(annotation, index);
965     }
966     
967     // BlockTree
968
/**
969      * Appends specified element <tt>statement</tt> to the end of statements
970      * list.
971      *
972      * @param block block tree containing statements list.
973      * @param statement element to be appended to statements list.
974      * @return block tree with modified statements
975      */

976     public BlockTree addBlockStatement(BlockTree block, StatementTree statement) {
977         return delegate.addBlockStatement(block, statement);
978     }
979     
980     /**
981      * Inserts the specified element <tt>statement</tt> at the specified
982      * position in statements list.
983      *
984      * @param block block tree with statements list
985      * @param index index at which the specified element is to be inserted.
986      * @param statement element to be inserted to statements list.
987      * @return block tree with modified statements
988      *
989      * @throws IndexOutOfBoundsException if the index is out of range
990      * (index &lt; 0 || index &gt; size()).
991      */

992     public BlockTree insertBlockStatement(BlockTree block, int index, StatementTree statement) {
993         return delegate.insertBlockStatement(block, index, statement);
994     }
995     
996     /**
997      * Removes the first occurrence in statements list of the specified
998      * element. If this list does not contain the element, it is
999      * unchanged.
1000     *
1001     * @param block block tree with statements list
1002     * @param statement element to be removed from this list, if present.
1003     * @return block tree with modified statements
1004     */

1005    public BlockTree removeBlockStatement(BlockTree block, StatementTree statement) {
1006        return delegate.removeBlockStatement(block, statement);
1007    }
1008    
1009    /**
1010     * Removes the element at the specified position in statements list.
1011     * Returns the modified block tree.
1012     *
1013     * @param block block tree with statements list
1014     * @param index the index of the element to be removed.
1015     * @return block tree with modified statements
1016     *
1017     * @throws IndexOutOfBoundsException if the index is out of range
1018     * (index &lt; 0 || index &gt;= size()).
1019     */

1020    public BlockTree removeBlockStatement(BlockTree block, int index) {
1021        return delegate.removeBlockStatement(block, index);
1022    }
1023    
1024    // CaseTree
1025
/**
1026     * Appends specified element <tt>statement</tt> to the end of statements
1027     * list.
1028     *
1029     * @param kejs case tree containing statements list.
1030     * @param statement element to be appended to statements list.
1031     * @return case tree with modified statements.
1032     */

1033    public CaseTree addCaseStatement(CaseTree kejs, StatementTree statement) {
1034        return delegate.addCaseStatement(kejs, statement);
1035    }
1036    
1037    /**
1038     * Inserts the specified element <tt>statement</tt> at the specified
1039     * position in statements list.
1040     *
1041     * @param kejs case tree containing statements list.
1042     * @param index index at which the specified element is to be inserted.
1043     * @param statement element to be inserted to statements list.
1044     * @return case tree with modified statements.
1045     *
1046     * @throws IndexOutOfBoundsException if the index is out of range
1047     * (index &lt; 0 || index &gt; size()).
1048     */

1049    public CaseTree insertCaseStatement(CaseTree kejs, int index, StatementTree statement) {
1050        return delegate.insertCaseStatement(kejs, index, statement);
1051    }
1052    
1053    /**
1054     * Removes the first occurrence in statements list of the specified
1055     * element. If this list does not contain the element, it is
1056     * unchanged.
1057     *
1058     * @param kejs case tree containing statements list.
1059     * @param statement element to be removed from this list, if present.
1060     * @return case tree with modified statements.
1061     */

1062    public CaseTree removeCaseStatement(CaseTree kejs, StatementTree statement) {
1063        return delegate.removeCaseStatement(kejs, statement);
1064    }
1065    
1066    /**
1067     * Removes the element at the specified position in statements list.
1068     * Returns the modified case tree.
1069     *
1070     * @param kejs case tree containing statements list.
1071     * @param index the index of the element to be removed.
1072     * @return case tree with modified statements.
1073     *
1074     * @throws IndexOutOfBoundsException if the index is out of range
1075     * (index &lt; 0 || index &gt;= size()).
1076     */

1077    public CaseTree removeCaseStatement(CaseTree kejs, int index) {
1078        return delegate.removeCaseStatement(kejs, index);
1079    }
1080    
1081    // ClassTree
1082
/**
1083     * Appends specified element <tt>member</tt> to the end of members
1084     * list. Consider you want to add such a method to the end of class:
1085     * <pre>
1086     * public void newlyCreatedMethod(int a, float b) throws java.io.IOException {
1087     * }
1088     * </pre>
1089     *
1090     * You can get it e.g. with this code:
1091     * <pre>
1092     * TreeMaker make = workingCopy.getTreeMaker();
1093     * ClassTree node = ...;
1094     * // create method modifiers
1095     * ModifiersTree parMods = make.Modifiers(Collections.EMPTY_SET, Collections.EMPTY_LIST);
1096     * // create parameters
1097     * VariableTree par1 = make.Variable(parMods, "a", make.PrimitiveType(TypeKind.INT), null);
1098     * VariableTree par2 = make.Variable(parMods, "b", make.PrimitiveType(TypeKind.FLOAT), null);
1099     * List<VariableTree> parList = new ArrayList<VariableTree>(2);
1100     * parList.add(par1);
1101     * parList.add(par2);
1102     * // create method
1103     * MethodTree newMethod = make.Method(
1104     * make.Modifiers(
1105     * Collections.singleton(Modifier.PUBLIC), // modifiers
1106     * Collections.EMPTY_LIST // annotations
1107     * ), // modifiers and annotations
1108     * "newlyCreatedMethod", // name
1109     * make.PrimitiveType(TypeKind.VOID), // return type
1110     * Collections.EMPTY_LIST, // type parameters for parameters
1111     * parList, // parameters
1112     * Collections.singletonList(make.Identifier("java.io.IOException")), // throws
1113     * make.Block(Collections.EMPTY_LIST, false), // empty statement block
1114     * null // default value - not applicable here, used by annotations
1115     * );
1116     * // rewrite the original class node with the new one containing newMethod
1117     * workingCopy.rewrite(node, <b>make.addClassMember(node, newMethod)</b>);
1118     * </pre>
1119     *
1120     * @param clazz class tree containing members list.
1121     * @param member element to be appended to members list.
1122     * @return class tree with modified members.
1123     */

1124    public ClassTree addClassMember(ClassTree clazz, Tree member) {
1125        return delegate.addClassMember(clazz, member);
1126    }
1127    
1128    /**
1129     * Inserts the specified element <tt>member</tt> at the specified
1130     * position in members list.
1131     *
1132     * @param clazz class tree with members list
1133     * @param index index at which the specified element is to be inserted.
1134     * @param member element to be inserted to members list.
1135     * @return class tree with modified members.
1136     *
1137     * @throws IndexOutOfBoundsException if the index is out of range
1138     * (index &lt; 0 || index &gt; size()).
1139     */

1140    public ClassTree insertClassMember(ClassTree clazz, int index, Tree member) {
1141        return delegate.insertClassMember(clazz, index, member);
1142    }
1143    
1144    /**
1145     * Removes the first occurrence in members list of the specified
1146     * element. If this list does not contain the element, it is
1147     * unchanged.
1148     *
1149     * @param clazz class tree with members list
1150     * @param member element to be removed from this list, if present.
1151     * @return class tree with modified members.
1152     */

1153    public ClassTree removeClassMember(ClassTree clazz, Tree member) {
1154        return delegate.removeClassMember(clazz, member);
1155    }
1156    
1157    /**
1158     * Removes the element at the specified position in members list.
1159     * Returns the modified class tree.
1160     *
1161     * @param clazz class tree with members list.
1162     * @param index the index of the element to be removed.
1163     * @return class tree with modified members.
1164     *
1165     * @throws IndexOutOfBoundsException if the index is out of range
1166     * (index &lt; 0 || index &gt;= size()).
1167     */

1168    public ClassTree removeClassMember(ClassTree clazz, int index) {
1169        return delegate.removeClassMember(clazz, index);
1170    }
1171    
1172    /**
1173     * Appends specified element <tt>typeParameter</tt> to the end of type parameters
1174     * list.
1175     *
1176     * @param clazz class tree containing type parameters list.
1177     * @param typeParameter element to be appended to type parameters list.
1178     * @return class tree with modified type parameters.
1179     */

1180    public ClassTree addClassTypeParameter(ClassTree clazz, TypeParameterTree typeParameter) {
1181        return delegate.addClassTypeParameter(clazz, typeParameter);
1182    }
1183    
1184    /**
1185     * Inserts the specified element <tt>member</tt> at the specified
1186     * position in type parameters list.
1187     *
1188     * @param clazz class tree with type parameters list
1189     * @param index index at which the specified element is to be inserted.
1190     * @param typeParameter element to be inserted to type parameters list.
1191     * @return class tree with modified type parameters.
1192     *
1193     * @throws IndexOutOfBoundsException if the index is out of range
1194     * (index &lt; 0 || index &gt; size()).
1195     */

1196    public ClassTree insertClassTypeParameter(ClassTree clazz, int index, TypeParameterTree typeParameter) {
1197        return delegate.insertClassTypeParameter(clazz, index, typeParameter);
1198    }
1199    
1200    /**
1201     * Removes the first occurrence in type parameters list of the specified
1202     * element. If this list does not contain the element, it is
1203     * unchanged.
1204     *
1205     * @param clazz class tree with type parameters list
1206     * @param typeParameter element to be removed from this list, if present.
1207     * @return class tree with modified type parameters.
1208     */

1209    public ClassTree removeClassTypeParameter(ClassTree clazz, TypeParameterTree typeParameter) {
1210        return delegate.removeClassTypeParameter(clazz, typeParameter);
1211    }
1212    
1213    /**
1214     * Removes the element at the specified position in type parameters list.
1215     * Returns the modified class tree.
1216     *
1217     * @param clazz class tree with type parameters list.
1218     * @param index the index of the element to be removed.
1219     * @return class tree with modified type parameters.
1220     *
1221     * @throws IndexOutOfBoundsException if the index is out of range
1222     * (index &lt; 0 || index &gt;= size()).
1223     */

1224    public ClassTree removeClassTypeParameter(ClassTree clazz, int index) {
1225        return delegate.removeClassTypeParameter(clazz, index);
1226    }
1227    
1228    /**
1229     * Appends specified element <tt>implementsClause</tt> to the end of implements
1230     * list.
1231     *
1232     * @param clazz class tree containing implements list.
1233     * @param implementsClause element to be appended to implements list.
1234     * @return class tree with modified implements.
1235     */

1236    public ClassTree addClassImplementsClause(ClassTree clazz, ExpressionTree implementsClause) {
1237        return delegate.addClassImplementsClause(clazz, implementsClause);
1238    }
1239    
1240    /**
1241     * Inserts the specified element <tt>implementsClause</tt> at the specified
1242     * position in implements list.
1243     *
1244     * @param clazz class tree with implements list
1245     * @param index index at which the specified element is to be inserted.
1246     * @param implementsClause element to be inserted to implements list.
1247     * @return class tree with modified implements.
1248     *
1249     * @throws IndexOutOfBoundsException if the index is out of range
1250     * (index &lt; 0 || index &gt; size()).
1251     */

1252    public ClassTree insertClassImplementsClause(ClassTree clazz, int index, ExpressionTree implementsClause) {
1253        return delegate.insertClassImplementsClause(clazz, index, implementsClause);
1254    }
1255    
1256    /**
1257     * Removes the first occurrence in implements list of the specified
1258     * element. If this list does not contain the element, it is
1259     * unchanged.
1260     *
1261     * @param clazz class tree with implements list
1262     * @param implementsClause element to be removed from this list, if present.
1263     * @return class tree with modified implements.
1264     */

1265    public ClassTree removeClassImplementsClause(ClassTree clazz, ExpressionTree implementsClause) {
1266        return delegate.removeClassImplementsClause(clazz, implementsClause);
1267    }
1268    
1269    /**
1270     * Removes the element at the specified position in implements list.
1271     * Returns the modified class tree.
1272     *
1273     * @param clazz class tree with implements list.
1274     * @param index the index of the element to be removed.
1275     * @return class tree with modified implements.
1276     *
1277     * @throws IndexOutOfBoundsException if the index is out of range
1278     * (index &lt; 0 || index &gt;= size()).
1279     */

1280    public ClassTree removeClassImplementsClause(ClassTree clazz, int index) {
1281        return delegate.removeClassImplementsClause(clazz, index);
1282    }
1283        
1284    // CompilationUnitTree
1285
/**
1286     * Appends specified element <tt>typeDeclaration</tt> to the end of type
1287     * declarations list.
1288     *
1289     * @param compilationUnit compilation unit tree containing type declarations list.
1290     * @param typeDeclaration element to be appended to type declarations list.
1291     * @return compilation unit tree with modified type declarations.
1292     */

1293    public CompilationUnitTree addCompUnitTypeDecl(CompilationUnitTree compilationUnit, Tree typeDeclaration) {
1294        return delegate.addCompUnitTypeDecl(compilationUnit, typeDeclaration);
1295    }
1296    
1297    /**
1298     * Inserts the specified element <tt>typeDeclaration</tt> at the specified
1299     * position in type declarations list.
1300     *
1301     * @param compilationUnit compilation unit tree containing type declarations list.
1302     * @param index index at which the specified element is to be inserted.
1303     * @param typeDeclaration element to be inserted to type declarations list.
1304     * @return compilation unit tree with modified type declarations.
1305     *
1306     * @throws IndexOutOfBoundsException if the index is out of range
1307     * (index &lt; 0 || index &gt; size()).
1308     */

1309    public CompilationUnitTree insertCompUnitTypeDecl(CompilationUnitTree compilationUnit, int index, Tree typeDeclaration) {
1310        return delegate.insertCompUnitTypeDecl(compilationUnit, index, typeDeclaration);
1311    }
1312    
1313    /**
1314     * Removes the first occurrence in type declarations list of the specified
1315     * element. If this list does not contain the element, it is
1316     * unchanged.
1317     *
1318     * @param compilationUnit compilation unit tree containing type declarations list.
1319     * @param typeDeclaration element to be removed from this list, if present.
1320     * @return compilation unit tree with modified type declarations.
1321     */

1322    public CompilationUnitTree removeCompUnitTypeDecl(CompilationUnitTree compilationUnit, Tree typeDeclaration) {
1323        return delegate.removeCompUnitTypeDecl(compilationUnit, typeDeclaration);
1324    }
1325    
1326    /**
1327     * Removes the element at the specified position in type declarations list.
1328     * Returns the modified compilation unit tree.
1329     *
1330     * @param compilationUnit compilation unit tree containing type declarations list.
1331     * @param index the index of the element to be removed.
1332     * @return compilation unit tree with modified type declarations.
1333     *
1334     * @throws IndexOutOfBoundsException if the index is out of range (index
1335     * &lt; 0 || index &gt;= size()).
1336     */

1337    public CompilationUnitTree removeCompUnitTypeDecl(CompilationUnitTree compilationUnit, int index) {
1338        return delegate.removeCompUnitTypeDecl(compilationUnit, index);
1339    }
1340    
1341    /**
1342     * Appends specified element <tt>importt</tt> to the end of imports list.
1343     *
1344     * @param compilationUnit compilation unit tree containing imports list.
1345     * @param importt element to be appended to list of imports.
1346     * @return compilation unit tree with modified imports.
1347     */

1348    public CompilationUnitTree addCompUnitImport(CompilationUnitTree compilationUnit, ImportTree importt) {
1349        return delegate.addCompUnitImport(compilationUnit, importt);
1350    }
1351    
1352    /**
1353     * Inserts the specified element <tt>importt</tt> at the specified
1354     * position in imports list.
1355     *
1356     * @param compilationUnit compilation unit tree containing imports list.
1357     * @param index index at which the specified element is to be inserted.
1358     * @param importt element to be inserted to list of imports.
1359     * @return compilation unit tree with modified imports.
1360     *
1361     * @throws IndexOutOfBoundsException if the index is out of range
1362     * (index &lt; 0 || index &gt; size()).
1363     */

1364    public CompilationUnitTree insertCompUnitImport(CompilationUnitTree compilationUnit, int index, ImportTree importt) {
1365        return delegate.insertCompUnitImport(compilationUnit, index, importt);
1366    }
1367    
1368    /**
1369     * Removes the first occurrence in imports list of the specified
1370     * element. If this list does not contain the element, it is
1371     * unchanged.
1372     *
1373     * @param compilationUnit compilation unit tree containing import list.
1374     * @param importt element to be removed from this list, if present.
1375     * @return compilation unit tree with modified imports.
1376     */

1377    public CompilationUnitTree removeCompUnitImport(CompilationUnitTree compilationUnit, ImportTree importt) {
1378        return delegate.removeCompUnitImport(compilationUnit, importt);
1379    }
1380    
1381    /**
1382     * Removes the element at the specified position in import list.
1383     * Returns the modified compilation unit tree.
1384     *
1385     * @param compilationUnit compilation unit tree containing import list.
1386     * @param index the index of the element to be removed.
1387     * @return compilation unit tree with modified imports.
1388     *
1389     * @throws IndexOutOfBoundsException if the index is out of range (index
1390     * &lt; 0 || index &gt;= size()).
1391     */

1392    public CompilationUnitTree removeCompUnitImport(CompilationUnitTree compilationUnit, int index) {
1393        return delegate.removeCompUnitImport(compilationUnit, index);
1394    }
1395    
1396    /** ErroneousTree */
1397    
1398    // ForLoopInitializer
1399
/**
1400     * Appends specified element <tt>initializer</tt> to the end of initializers
1401     * list.
1402     *
1403     * @param forLoop for loop tree containing initializers list.
1404     * @param initializer element to be appended to initializers list.
1405     * @return for loop tree with modified initializers.
1406     */

1407    public ForLoopTree addForLoopInitializer(ForLoopTree forLoop, StatementTree initializer) {
1408        return delegate.addForLoopInitializer(forLoop, initializer);
1409    }
1410    
1411    /**
1412     * Inserts the specified element <tt>initializer</tt> at the specified
1413     * position in initializers list.
1414     *
1415     * @param forLoop for loop tree containing initializers list.
1416     * @param index index at which the specified element is to be inserted.
1417     * @param initializer element to be inserted to initializers list.
1418     * @return for loop tree with modified initializers.
1419     *
1420     * @throws IndexOutOfBoundsException if the index is out of range
1421     * (index &lt; 0 || index &gt; size()).
1422     */

1423    public ForLoopTree insertForLoopInitializer(ForLoopTree forLoop, int index, StatementTree initializer) {
1424        return delegate.insertForLoopInitializer(forLoop, index, initializer);
1425    }
1426    
1427    /**
1428     * Removes the first occurrence in initializers list of the specified
1429     * element. If this list does not contain the element, it is
1430     * unchanged.
1431     *
1432     * @param forLoop for loop tree containing initializers list.
1433     * @param initializer element to be removed from this list, if present.
1434     * @return for loop tree with modified initializers.
1435     */

1436    public ForLoopTree removeForLoopInitializer(ForLoopTree forLoop, StatementTree initializer) {
1437        return delegate.removeForLoopInitializer(forLoop, initializer);
1438    }
1439    
1440    /**
1441     * Removes the element at the specified position in initializers list.
1442     * Returns the modified for loop tree.
1443     *
1444     * @param forLoop for loop tree containing initializers list.
1445     * @param index the index of the element to be removed.
1446     * @return for loop tree with modified initializers.
1447     *
1448     * @throws IndexOutOfBoundsException if the index is out of range (index
1449     * &lt; 0 || index &gt;= size()).
1450     */

1451    public ForLoopTree removeForLoopInitializer(ForLoopTree forLoop, int index) {
1452        return delegate.removeForLoopInitializer(forLoop, index);
1453    }
1454    
1455    // ForLoopUpdate
1456
/**
1457     * Appends specified element <tt>update</tt> to the end of updates
1458     * list.
1459     *
1460     * @param forLoop for loop tree containing updates list.
1461     * @param update element to be appended to updates list.
1462     * @return for loop tree with modified updates.
1463     */

1464    public ForLoopTree addForLoopUpdate(ForLoopTree forLoop, ExpressionStatementTree update) {
1465        return delegate.addForLoopUpdate(forLoop, update);
1466    }
1467    
1468    /**
1469     * Inserts the specified element <tt>update</tt> at the specified
1470     * position in updates list.
1471     *
1472     * @param forLoop for loop tree containing updates list.
1473     * @param index index at which the specified element is to be inserted.
1474     * @param update element to be inserted to updates list.
1475     * @return for loop tree with modified updates.
1476     *
1477     * @throws IndexOutOfBoundsException if the index is out of range
1478     * (index &lt; 0 || index &gt; size()).
1479     */

1480    public ForLoopTree insertForLoopUpdate(ForLoopTree forLoop, int index, ExpressionStatementTree update) {
1481        return delegate.insertForLoopUpdate(forLoop, index, update);
1482    }
1483    
1484    /**
1485     * Removes the first occurrence in updates list of the specified
1486     * element. If this list does not contain the element, it is
1487     * unchanged.
1488     *
1489     * @param forLoop for loop tree containing updates list.
1490     * @param update element to be removed from this list, if present.
1491     * @return for loop tree with modified updates.
1492     */

1493    public ForLoopTree removeForLoopUpdate(ForLoopTree forLoop, ExpressionStatementTree update) {
1494        return delegate.removeForLoopUpdate(forLoop, update);
1495    }
1496    
1497    /**
1498     * Removes the element at the specified position in updates list.
1499     * Returns the modified for loop tree.
1500     *
1501     * @param forLoop for loop tree containing updates list.
1502     * @param index the index of the element to be removed.
1503     * @return for loop tree with modified updates.
1504     *
1505     * @throws IndexOutOfBoundsException if the index is out of range (index
1506     * &lt; 0 || index &gt;= size()).
1507     */

1508    public ForLoopTree removeForLoopUpdate(ForLoopTree forLoop, int index) {
1509        return delegate.removeForLoopUpdate(forLoop, index);
1510    }
1511    
1512    // MethodInvocation
1513
/**
1514     * Appends specified element <tt>argument</tt> with related
1515     * <tt>typeArgument</tt> to the end of arguments/type arguments list.
1516     *
1517     * @param methodInvocation method invocation tree containing arguments list.
1518     * @param argument element to be appended to arguments list.
1519     * @param typeArgument element to be appended to type arguments list.
1520     * @return method invocation tree with modified arguments and type arguments.
1521     */

1522    public MethodInvocationTree addMethodInvocationArgument(MethodInvocationTree methodInvocation, ExpressionTree argument, ExpressionTree typeArgument) {
1523        return delegate.addMethodInvocationArgument(methodInvocation, argument, typeArgument);
1524    }
1525    
1526    /**
1527     * Inserts the specified element <tt>argument</tt> with related
1528     * <tt>typeArgument</tt> at the specified position in arguments/type arguments list.
1529     *
1530     * @param methodInvocation method invocation tree containing arguments list.
1531     * @param index index at which the specified elements is to be inserted.
1532     * @param argument element to be inserted to arguments list.
1533     * @param typeArgument element to be inserted to type arguments list.
1534     * @return method invocation tree with modified type arguments and type arguments.
1535     *
1536     * @throws IndexOutOfBoundsException if the index is out of range
1537     * (index &lt; 0 || index &gt; size()).
1538     */

1539    public MethodInvocationTree insertMethodInvocationArgument(MethodInvocationTree methodInvocation, int index, ExpressionTree argument, ExpressionTree typeArgument) {
1540        return delegate.insertMethodInvocationArgument(methodInvocation, index, argument, typeArgument);
1541    }
1542    
1543    /** TODO: Strange method - different arguments/type arguments can be removed.
1544     * just argument should be passed to the method.
1545     * Removes the first occurrence in arguments and type arguments list
1546     * of the specified elements. If this list do not contain the elements, it is
1547     * unchanged.
1548     *
1549     * @param methodInvocation method invocation tree containing arguments list.
1550     * @param argument element to be removed from this list, if present.
1551     * @param typeArgument element to be removed from this list, if present.
1552     * @return method invocation tree with modified arguments and type arguments.
1553     */

1554    public MethodInvocationTree removeMethodInvocationArgument(MethodInvocationTree methodInvocation, ExpressionTree argument, ExpressionTree typeArgument) {
1555        return delegate.removeMethodInvocationArgument(methodInvocation, argument, typeArgument);
1556    }
1557    
1558    /**
1559     * Removes the element at the specified position in arguments and
1560     * type arguments list. Returns the modified method invocation tree.
1561     *
1562     * @param methodInvocation method invocation tree containing arguments list.
1563     * @param index the index of the element to be removed.
1564     * @return method invocation tree with modified arguments and type arguments.
1565     *
1566     * @throws IndexOutOfBoundsException if the index is out of range (index
1567     * &lt; 0 || index &gt;= size()).
1568     */

1569    public MethodInvocationTree removeMethodInvocationArgument(MethodInvocationTree methodInvocation, int index) {
1570        return delegate.removeMethodInvocationArgument(methodInvocation, index);
1571    }
1572    
1573    // Method
1574
/**
1575     * Appends specified element <tt>parameter</tt>
1576     * to the end of parameters list.
1577     *
1578     * @param method method tree containing parameters list.
1579     * @param parameter element to be appended to parameters list.
1580     * @return method tree with modified parameters.
1581     */

1582    public MethodTree addMethodParameter(MethodTree method, VariableTree parameter) {
1583        return delegate.addMethodParameter(method, parameter);
1584    }
1585    
1586    /**
1587     * Inserts the specified element <tt>parameter</tt>
1588     * at the specified position in parameters list.
1589     *
1590     * @param method method tree containing parameters list.
1591     * @param index index at which the specified elements is to be inserted.
1592     * @param parameter element to be inserted to parameters list.
1593     * @return method tree with modified parameters.
1594     *
1595     * @throws IndexOutOfBoundsException if the index is out of range
1596     * (index &lt; 0 || index &gt; size()).
1597     */

1598    public MethodTree insertMethodParameter(MethodTree method, int index, VariableTree parameter) {
1599        return delegate.insertMethodParameter(method, index, parameter);
1600    }
1601    
1602    /**
1603     * Removes the first occurrence in parameters list of the specified
1604     * elements. If this list do not contain the element, it is
1605     * unchanged.
1606     *
1607     * @param method method tree containing parameters list.
1608     * @param parameter element to be removed from this list, if present.
1609     * @return method tree with modified parameters and type parameters.
1610     */

1611    public MethodTree removeMethodParameter(MethodTree method, VariableTree parameter) {
1612        return delegate.removeMethodParameter(method, parameter);
1613    }
1614    
1615    /**
1616     * Removes the element at the specified position in parameters list.
1617     * Returns the modified method tree.
1618     *
1619     * @param method method tree containing parameters list.
1620     * @param index the index of the element to be removed.
1621     * @return method tree with modified parameters.
1622     *
1623     * @throws IndexOutOfBoundsException if the index is out of range (index
1624     * &lt; 0 || index &gt;= size()).
1625     */

1626    public MethodTree removeMethodParameter(MethodTree method, int index) {
1627        return delegate.removeMethodParameter(method, index);
1628    }
1629    
1630    /**
1631     * Appends specified element <tt>typeParameter</tt>
1632     * to the end of type parameters list.
1633     *
1634     * @param method method tree containing type parameters list.
1635     * @param typeParameter element to be appended to type parameters list.
1636     * @return method tree with modified type parameters.
1637     */

1638    public MethodTree addMethodTypeParameter(MethodTree method, TypeParameterTree typeParameter) {
1639        return delegate.addMethodTypeParameter(method, typeParameter);
1640    }
1641    
1642    /**
1643     * Inserts the specified element <tt>typeParameter</tt>
1644     * at the specified position in type parameters list.
1645     *
1646     * @param method method tree containing parameters list.
1647     * @param index index at which the specified elements is to be inserted.
1648     * @param typeParameter element to be inserted to type parameters list.
1649     * @return method tree with modified type parameters.
1650     *
1651     * @throws IndexOutOfBoundsException if the index is out of range
1652     * (index &lt; 0 || index &gt; size()).
1653     */

1654    public MethodTree insertMethodTypeParameter(MethodTree method, int index, TypeParameterTree typeParameter) {
1655        return delegate.insertMethodTypeParameter(method, index, typeParameter);
1656    }
1657    
1658    /**
1659     * Removes the first occurrence in type parameters list of the specified
1660     * elements. If this list do not contain the element, it is
1661     * unchanged.
1662     *
1663     * @param method method tree containing type parameters list.
1664     * @param typeParameter element to be removed from this list, if present.
1665     * @return method tree with modified type parameters.
1666     */

1667    public MethodTree removeMethodTypeParameter(MethodTree method, TypeParameterTree typeParameter) {
1668        return delegate.removeMethodTypeParameter(method, typeParameter);
1669    }
1670    
1671    /**
1672     * Removes the element at the specified position in type parameters list.
1673     * Returns the modified method tree.
1674     *
1675     * @param method method tree containing type parameters list.
1676     * @param index the index of the element to be removed.
1677     * @return method tree with modified type parameters.
1678     *
1679     * @throws IndexOutOfBoundsException if the index is out of range (index
1680     * &lt; 0 || index &gt;= size()).
1681     */

1682    public MethodTree removeMethodTypeParameter(MethodTree method, int index) {
1683        return delegate.removeMethodTypeParameter(method, index);
1684    }
1685    
1686    /**
1687     * Appends specified element <tt>throwz</tt> to the end of throws
1688     * list.
1689     *
1690     * @param method method tree containing throws list.
1691     * @param throwz element to be appended to throws list.
1692     * @return method tree with modified throws.
1693     */

1694    public MethodTree addMethodThrows(MethodTree method, ExpressionTree throwz) {
1695        return delegate.addMethodThrows(method, throwz);
1696    }
1697    
1698    /**
1699     * Inserts the specified element <tt>throws</tt> at the specified
1700     * position in throws list.
1701     *
1702     * @param method method tree containing throws list.
1703     * @param index index at which the specified element is to be inserted.
1704     * @param throwz element to be inserted to throws list.
1705     * @return method tree with modified throws.
1706     *
1707     * @throws IndexOutOfBoundsException if the index is out of range
1708     * (index &lt; 0 || index &gt; size()).
1709     */

1710    public MethodTree insertMethodThrows(MethodTree method, int index, ExpressionTree throwz) {
1711        return delegate.insertMethodThrows(method, index, throwz);
1712    }
1713    
1714    /**
1715     * Removes the first occurrence in throws list of the specified
1716     * element. If this list does not contain the element, it is
1717     * unchanged.
1718     *
1719     * @param method method tree containing throws list.
1720     * @param throwz element to be removed from this list, if present.
1721     * @return method tree with modified throws.
1722     */

1723    public MethodTree removeMethodThrows(MethodTree method, ExpressionTree throwz) {
1724        return delegate.removeMethodThrows(method, throwz);
1725    }
1726    
1727    /**
1728     * Removes the element at the specified position in throws list.
1729     * Returns the modified method tree.
1730     *
1731     * @param method method tree containing throws list.
1732     * @param index the index of the element to be removed.
1733     * @return method tree with modified throws.
1734     *
1735     * @throws IndexOutOfBoundsException if the index is out of range (index
1736     * &lt; 0 || index &gt;= size()).
1737     */

1738    public MethodTree removeMethodThrows(MethodTree method, int index) {
1739        return delegate.removeMethodThrows(method, index);
1740    }
1741    
1742    // Modifiers
1743
/**
1744     * Appends specified element <tt>annotation</tt> to the end of annotations
1745     * list.
1746     *
1747     * @param modifiers modifiers tree containing annotations list.
1748     * @param annotation element to be appended to annotations list.
1749     * @return modifiers tree with modified annotations.
1750     */

1751    public ModifiersTree addModifiersAnnotation(ModifiersTree modifiers, AnnotationTree annotation) {
1752        return delegate.addModifiersAnnotation(modifiers, annotation);
1753    }
1754    
1755    /**
1756     * Inserts the specified element <tt>annotation</tt> at the specified
1757     * position in annotations list.
1758     *
1759     * @param modifiers modifiers tree containing annotations list.
1760     * @param index index at which the specified element is to be inserted.
1761     * @param annotation element to be inserted to annotations list.
1762     * @return modifiers tree with modified annotations.
1763     *
1764     * @throws IndexOutOfBoundsException if the index is out of range
1765     * (index &lt; 0 || index &gt; size()).
1766     */

1767    public ModifiersTree insertModifiersAnnotation(ModifiersTree modifiers, int index, AnnotationTree annotation) {
1768        return delegate.insertModifiersAnnotation(modifiers, index, annotation);
1769    }
1770    
1771    /**
1772     * Removes the first occurrence in annotations list of the specified
1773     * element. If this list does not contain the element, it is
1774     * unchanged.
1775     *
1776     * @param modifiers modifiers tree containing annotations list.
1777     * @param annotation element to be removed from this list, if present.
1778     * @return modifiers tree with modified annotations.
1779     */

1780    public ModifiersTree removeModifiersAnnotation(ModifiersTree modifiers, AnnotationTree annotation) {
1781        return delegate.removeModifiersAnnotation(modifiers, annotation);
1782    }
1783    
1784    /**
1785     * Removes the element at the specified position in annotations list.
1786     * Returns the modified modifiers tree.
1787     *
1788     * @param modifiers modifiers tree containing annotations list.
1789     * @param index the index of the element to be removed.
1790     * @return modifiers tree with modified annotations.
1791     *
1792     * @throws IndexOutOfBoundsException if the index is out of range (index
1793     * &lt; 0 || index &gt;= size()).
1794     */

1795    public ModifiersTree removeModifiersAnnotation(ModifiersTree modifiers, int index) {
1796        return delegate.removeModifiersAnnotation(modifiers, index);
1797    }
1798    
1799    // NewArray
1800
/**
1801     * Appends specified element <tt>dimension</tt> to the end of dimensions
1802     * list.
1803     *
1804     * @param newArray new array tree containing dimensions list.
1805     * @param dimension element to be appended to dimensions list.
1806     * @return new array tree with modified dimensions.
1807     */

1808    public NewArrayTree addNewArrayDimension(NewArrayTree newArray, ExpressionTree dimension) {
1809        return delegate.addNewArrayDimension(newArray, dimension);
1810    }
1811    
1812    /**
1813     * Inserts the specified element <tt>dimension</tt> at the specified
1814     * position in dimensions list.
1815     *
1816     * @param newArray new array tree containing dimensions list.
1817     * @param index index at which the specified element is to be inserted.
1818     * @param dimension element to be inserted to dimensions list.
1819     * @return new array tree with modified dimensions.
1820     *
1821     * @throws IndexOutOfBoundsException if the index is out of range
1822     * (index &lt; 0 || index &gt; size()).
1823     */

1824    public NewArrayTree insertNewArrayDimension(NewArrayTree newArray, int index, ExpressionTree dimension) {
1825        return delegate.insertNewArrayDimension(newArray, index, dimension);
1826    }
1827    
1828    /**
1829     * Removes the first occurrence in dimensions list of the specified
1830     * element. If this list does not contain the element, it is
1831     * unchanged.
1832     *
1833     * @param newArray new array tree containing dimensions list.
1834     * @param dimension element to be removed from this list, if present.
1835     * @return new array tree with modified dimensions.
1836     */

1837    public NewArrayTree removeNewArrayDimension(NewArrayTree newArray, ExpressionTree dimension) {
1838        return delegate.removeNewArrayDimension(newArray, dimension);
1839    }
1840    
1841    /**
1842     * Removes the element at the specified position in dimensions list.
1843     * Returns the modified new array tree.
1844     *
1845     * @param newArray new array tree containing dimensions list.
1846     * @param index the index of the element to be removed.
1847     * @return new array tree with modified dimensions.
1848     *
1849     * @throws IndexOutOfBoundsException if the index is out of range (index
1850     * &lt; 0 || index &gt;= size()).
1851     */

1852    public NewArrayTree removeNewArrayDimension(NewArrayTree newArray, int index) {
1853        return delegate.removeNewArrayDimension(newArray, index);
1854    }
1855
1856    // NewArrayTree
1857
/**
1858     * Appends specified element <tt>initializer</tt> to the end of initializers
1859     * list.
1860     *
1861     * @param newArray new array tree containing initializers list.
1862     * @param initializer element to be appended to initializers list.
1863     * @return new array tree with modified initializers.
1864     */

1865    public NewArrayTree addNewArrayInitializer(NewArrayTree newArray, ExpressionTree initializer) {
1866        return delegate.addNewArrayInitializer(newArray, initializer);
1867    }
1868    
1869    /**
1870     * Inserts the specified element <tt>initializer</tt> at the specified
1871     * position in initializers list.
1872     *
1873     * @param newArray new array tree containing initializers list.
1874     * @param index index at which the specified element is to be inserted.
1875     * @param initializer element to be inserted to initializers list.
1876     * @return new array tree with modified initializers.
1877     *
1878     * @throws IndexOutOfBoundsException if the index is out of range
1879     * (index &lt; 0 || index &gt; size()).
1880     */

1881    public NewArrayTree insertNewArrayInitializer(NewArrayTree newArray, int index, ExpressionTree initializer) {
1882        return delegate.insertNewArrayInitializer(newArray, index, initializer);
1883    }
1884    
1885    /**
1886     * Removes the first occurrence in initializers list of the specified
1887     * element. If this list does not contain the element, it is
1888     * unchanged.
1889     *
1890     * @param newArray new array tree containing initializers list.
1891     * @param initializer element to be removed from this list, if present.
1892     * @return new array tree with modified initializers.
1893     */

1894    public NewArrayTree removeNewArrayInitializer(NewArrayTree newArray, ExpressionTree initializer) {
1895        return delegate.removeNewArrayInitializer(newArray, initializer);
1896    }
1897    
1898    /**
1899     * Removes the element at the specified position in initializers list.
1900     * Returns the modified new array tree.
1901     *
1902     * @param newArray new array tree containinginitializers list.
1903     * @param index the index of the element to be removed.
1904     * @return new array tree with modified initializers.
1905     *
1906     * @throws IndexOutOfBoundsException if the index is out of range (index
1907     * &lt; 0 || index &gt;= size()).
1908     */

1909    public NewArrayTree removeNewArrayInitializer(NewArrayTree newArray, int index) {
1910        return delegate.removeNewArrayInitializer(newArray, index);
1911    }
1912    
1913    // NewClass
1914
/**
1915     * Appends specified element <tt>argument</tt> with related
1916     * <tt>typeArgument</tt> to the end of arguments/type arguments list.
1917     *
1918     * @param newClass new class tree containing arguments list.
1919     * @param typeArgument element to be appended to type arguments list.
1920     * @param argument element to be appended to arguments list.
1921     * @return new class tree with modified arguments and type arguments.
1922     */

1923    public NewClassTree addNewClassArgument(NewClassTree newClass, ExpressionTree typeArgument, ExpressionTree argument) {
1924        return delegate.addNewClassArgument(newClass, typeArgument, argument);
1925    }
1926    
1927    /**
1928     * Inserts the specified element <tt>argument</tt> with related
1929     * <tt>typeArgument</tt> at the specified position in arguments/type arguments list.
1930     *
1931     * @param newClass new class tree containing type arguments list.
1932     * @param index index at which the specified elements is to be inserted.
1933     * @param typeArgument element to be inserted to type arguments list.
1934     * @param argument element to be inserted to arguments list.
1935     * @return new class tree with modified type arguments and type arguments.
1936     *
1937     * @throws IndexOutOfBoundsException if the index is out of range
1938     * (index &lt; 0 || index &gt; size()).
1939     */

1940    public NewClassTree insertNewClassArgument(NewClassTree newClass, int index, ExpressionTree typeArgument, ExpressionTree argument) {
1941        return delegate.insertNewClassArgument(newClass, index, typeArgument, argument);
1942    }
1943    
1944    /** TODO: Strange method - different arguments/type arguments can be removed.
1945     * just argument should be passed to the method.
1946     * Removes the first occurrence in arguments and type arguments list
1947     * of the specified elements. If this list do not contain the elements, it is
1948     * unchanged.
1949     *
1950     * @param newClass new class tree containing type arguments list.
1951     * @param typeArgument element to be removed from this list, if present.
1952     * @param argument element to be removed from this list, if present.
1953     * @return new class tree with modified arguments and type arguments.
1954     */

1955    public NewClassTree removeNewClassArgument(NewClassTree newClass, ExpressionTree typeArgument, ExpressionTree argument) {
1956        return delegate.removeNewClassArgument(newClass, typeArgument, argument);
1957    }
1958    
1959    /**
1960     * Removes the element at the specified position in arguments and
1961     * type arguments list. Returns the modified new class tree.
1962     *
1963     * @param newClass new class tree containing type arguments list.
1964     * @param index the index of the element to be removed.
1965     * @return new class tree with modified arguments and type arguments.
1966     *
1967     * @throws IndexOutOfBoundsException if the index is out of range (index
1968     * &lt; 0 || index &gt;= size()).
1969     */

1970    public NewClassTree removeNewClassArgument(NewClassTree newClass, int index) {
1971        return delegate.removeNewClassArgument(newClass, index);
1972    }
1973
1974    // ParameterizedType
1975
/**
1976     * Appends specified element <tt>argument</tt> to the end of type arguments
1977     * list.
1978     *
1979     * @param parameterizedType parameterized type tree containing type arguments list.
1980     * @param argument element to be appended to type arguments list.
1981     * @return parameterized type tree with modified type arguments.
1982     */

1983    public ParameterizedTypeTree addParameterizedTypeTypeArgument(ParameterizedTypeTree parameterizedType, ExpressionTree argument) {
1984        return delegate.addParameterizedTypeTypeArgument(parameterizedType, argument);
1985    }
1986    
1987    /**
1988     * Inserts the specified element <tt>argument</tt> at the specified
1989     * position in type arguments list.
1990     *
1991     * @param parameterizedType parameterized type tree containing type arguments list.
1992     * @param index index at which the specified element is to be inserted.
1993     * @param argument element to be inserted to type arguments list.
1994     * @return parameterized type tree with modified type arguments.
1995     *
1996     * @throws IndexOutOfBoundsException if the index is out of range
1997     * (index &lt; 0 || index &gt; size()).
1998     */

1999    public ParameterizedTypeTree insertParameterizedTypeTypeArgument(ParameterizedTypeTree parameterizedType, int index, ExpressionTree argument) {
2000        return delegate.insertParameterizedTypeTypeArgument(parameterizedType, index, argument);
2001    }
2002    
2003    /**
2004     * Removes the first occurrence in type arguments list of the specified
2005     * element. If this list does not contain the element, it is
2006     * unchanged.
2007     *
2008     * @param parameterizedType parameterized type tree containing type arguments list.
2009     * @param argument element to be removed from this list, if present.
2010     * @return parameterized type tree with modified type arguments.
2011     */

2012    public ParameterizedTypeTree removeParameterizedTypeTypeArgument(ParameterizedTypeTree parameterizedType, ExpressionTree argument) {
2013        return delegate.removeParameterizedTypeTypeArgument(parameterizedType, argument);
2014    }
2015    
2016    /**
2017     * Removes the element at the specified position in type arguments list.
2018     * Returns the modified parameterized type tree.
2019     *
2020     * @param parameterizedType parameterized type tree containing type arguments list.
2021     * @param index the index of the element to be removed.
2022     * @return parameterized type tree with modified type arguments.
2023     *
2024     * @throws IndexOutOfBoundsException if the index is out of range (index
2025     * &lt; 0 || index &gt;= size()).
2026     */

2027    public ParameterizedTypeTree removeParameterizedTypeTypeArgument(ParameterizedTypeTree parameterizedType, int index) {
2028        return delegate.removeParameterizedTypeTypeArgument(parameterizedType, index);
2029    }
2030
2031    // Switch
2032
/**
2033     * Appends specified element <tt>kejs</tt> to the end of cases
2034     * list.
2035     *
2036     * @param swic switch tree containing cases list.
2037     * @param kejs element to be appended to cases list.
2038     * @return switch tree with modified cases.
2039     */

2040    public SwitchTree addSwitchCase(SwitchTree swic, CaseTree kejs) {
2041        return delegate.addSwitchCase(swic, kejs);
2042    }
2043    
2044    /**
2045     * Inserts the specified element <tt>kejs</tt> at the specified
2046     * position in cases list.
2047     *
2048     * @param swic switch tree containing cases list.
2049     * @param index index at which the specified element is to be inserted.
2050     * @param kejs element to be inserted to cases list.
2051     * @return switch tree with modified cases.
2052     *
2053     * @throws IndexOutOfBoundsException if the index is out of range
2054     * (index &lt; 0 || index &gt; size()).
2055     */

2056    public SwitchTree insertSwitchCase(SwitchTree swic, int index, CaseTree kejs) {
2057        return delegate.insertSwitchCase(swic, index, kejs);
2058    }
2059    
2060    /**
2061     * Removes the first occurrence in cases list of the specified
2062     * element. If this list does not contain the element, it is
2063     * unchanged.
2064     *
2065     * @param swic switch tree containing cases list.
2066     * @param kejs element to be removed from this list, if present.
2067     * @return switch tree with modified cases.
2068     */

2069    public SwitchTree removeSwitchCase(SwitchTree swic, CaseTree kejs) {
2070        return delegate.removeSwitchCase(swic, kejs);
2071    }
2072    
2073    /**
2074     * Removes the element at the specified position in cases list.
2075     * Returns the modified switch tree.
2076     *
2077     * @param swic switch tree containing cases list.
2078     * @param index the index of the element to be removed.
2079     * @return switch tree with modified cases.
2080     *
2081     * @throws IndexOutOfBoundsException if the index is out of range (index
2082     * &lt; 0 || index &gt;= size()).
2083     */

2084    public SwitchTree removeSwitchCase(SwitchTree swic, int index) {
2085        return delegate.removeSwitchCase(swic, index);
2086    }
2087    
2088    // Try
2089
/**
2090     * Appends specified element <tt>kec</tt> to the end of catches
2091     * list.
2092     *
2093     * @param traj try tree containing catches list.
2094     * @param kec element to be appended to catches list.
2095     * @return try tree with modified catches.
2096     */

2097    public TryTree addTryCatch(TryTree traj, CatchTree kec) {
2098        return delegate.addTryCatch(traj, kec);
2099    }
2100    
2101    /**
2102     * Inserts the specified element <tt>kec</tt> at the specified
2103     * position in catches list.
2104     *
2105     * @param traj try tree containing catches list.
2106     * @param index index at which the specified element is to be inserted.
2107     * @param kec element to be inserted to catches list.
2108     * @return try tree with modified catches.
2109     *
2110     * @throws IndexOutOfBoundsException if the index is out of range
2111     * (index &lt; 0 || index &gt; size()).
2112     */

2113    public TryTree insertTryCatch(TryTree traj, int index, CatchTree kec) {
2114        return delegate.insertTryCatch(traj, index, kec);
2115    }
2116    
2117    /**
2118     * Removes the first occurrence in catches list of the specified
2119     * element. If this list does not contain the element, it is
2120     * unchanged.
2121     *
2122     * @param traj try tree containing catches list.
2123     * @param kec element to be removed from this list, if present.
2124     * @return try tree with modified catches.
2125     */

2126    public TryTree removeTryCatch(TryTree traj, CatchTree kec) {
2127        return delegate.removeTryCatch(traj, kec);
2128    }
2129    
2130    /**
2131     * Removes the element at the specified position in catches list.
2132     * Returns the modified try tree.
2133     *
2134     * @param traj try tree containing catches list.
2135     * @param index the index of the element to be removed.
2136     * @return try tree with modified catches.
2137     *
2138     * @throws IndexOutOfBoundsException if the index is out of range (index
2139     * &lt; 0 || index &gt;= size()).
2140     */

2141    public TryTree removeTryCatch(TryTree traj, int index) {
2142        return delegate.removeTryCatch(traj, index);
2143    }
2144            
2145    /**
2146     * Appends specified element <tt>bound</tt> to the end of bounds
2147     * list.
2148     *
2149     * @param typeParameter type parameter tree containing bounds list.
2150     * @param bound element to be appended to bounds list.
2151     * @return type parameter tree with modified bounds.
2152     */

2153    public TypeParameterTree addTypeParameterBound(TypeParameterTree typeParameter, ExpressionTree bound) {
2154        return delegate.addTypeParameterBound(typeParameter, bound);
2155    }
2156    
2157    /**
2158     * Inserts the specified element <tt>bound</tt> at the specified
2159     * position in bounds list.
2160     *
2161     * @param typeParameter type parameter tree containing bounds list.
2162     * @param index index at which the specified element is to be inserted.
2163     * @param bound element to be inserted to bounds list.
2164     * @return type parameter tree with modified bounds.
2165     *
2166     * @throws IndexOutOfBoundsException if the index is out of range
2167     * (index &lt; 0 || index &gt; size()).
2168     */

2169    public TypeParameterTree insertTypeParameterBound(TypeParameterTree typeParameter, int index, ExpressionTree bound) {
2170        return delegate.insertTypeParameterBound(typeParameter, index, bound);
2171    }
2172    
2173    /**
2174     * Removes the first occurrence in bounds list of the specified
2175     * element. If this list does not contain the element, it is
2176     * unchanged.
2177     *
2178     * @param typeParameter type parameter tree containing bounds list.
2179     * @param bound element to be removed from this list, if present.
2180     * @return type parameter tree with modified bounds.
2181     */

2182    public TypeParameterTree removeTypeParameterBound(TypeParameterTree typeParameter, ExpressionTree bound) {
2183        return delegate.removeTypeParameterBound(typeParameter, bound);
2184    }
2185    
2186    /**
2187     * Removes the element at the specified position in bounds list.
2188     * Returns the modified type parameter tree.
2189     *
2190     * @param typeParameter type parameter tree containing bounds list.
2191     * @param index the index of the element to be removed.
2192     * @return type parameter tree with modified bounds.
2193     *
2194     * @throws IndexOutOfBoundsException if the index is out of range (index
2195     * &lt; 0 || index &gt;= size()).
2196     */

2197    public TypeParameterTree removeTypeParameterBound(TypeParameterTree typeParameter, int index) {
2198        return delegate.removeTypeParameterBound(typeParameter, index);
2199    }
2200    
2201    /**
2202     * Replaces the original <tt>node</tt>'s label with new one provided in
2203     * <tt>aLabel</tt> argument. Throws <tt>IllegalArgumentException</tt> if
2204     * <tt>node</tt>'s kind is invalid. Valid <tt>node</tt>'s kinds are:<br>
2205     * BREAK, CLASS, CONTINUE, IDENTIFIER, LABELED_STATEMENT,
2206     * MEMBER_SELECT, METHOD, TYPE_PARAMETER, VARIABLE.<p>
2207     *
2208     * Consider you want to change name of method <tt>fooMet</tt> to
2209     * <tt>fooMethod</tt>:
2210     *
2211     * <pre>
2212     * public void fooMet() throws java.io.IOException {
2213     * ...
2214     * }
2215     * </pre>
2216     *
2217     * You can get it e.g. with this code:
2218     * <pre>
2219     * MethodTree footMet = <I>contains footMet tree</I>;
2220     * MethodTree fooMethod = make.setLabel(fooMet, "fooMethod");
2221     * workingCopy.rewrite(node, njuMethod);
2222     * </pre>
2223     *
2224     * This code will result to:
2225     * <pre>
2226     * public void fooMethod() throws java.io.IOException {
2227     * ...
2228     * }
2229     * </pre>
2230     *
2231     * @param node argument will be duplicated and its label replaced
2232     * with <tt>aLabel</tt>
2233     * @param aLabel represents new <tt>node</tt>'s name or other label
2234     * @throws java.lang.IllegalArgumentException if the user provides
2235     * illegal <tt>node</tt>'s kind, i.e. if the provided
2236     * <tt>node</tt> does not contain any name or <tt>String</tt>.
2237     * @return duplicated <tt>node</tt> with a new name
2238     */

2239    public <N extends Tree> N setLabel(final N node, final CharSequence JavaDoc aLabel) {
2240        return delegate.setLabel(node, aLabel);
2241    }
2242
2243    /**
2244     * Replaces extends clause in class declaration. Consider you want to make
2245     * <code>Matricale</code> class extending class <code>Yerba</code>.
2246     *
2247     * You have the class available:
2248     *
2249     * <pre>
2250     * public class Matricale {
2251     * ...
2252     * }
2253     * </pre>
2254     *
2255     * Running following code:
2256     * <pre>
2257     * TreeMaker make = workingCopy.getTreeMaker();
2258     * ClassTree matricale = <i>contains Matricale class</i>;
2259     * ClassTree modified = make.setExtends(matricale, make.Identifier("Yerba"));
2260     * workingCopy.rewrite(matricale, modified);
2261     * </pre>
2262     *
2263     * will result to:
2264     *
2265     * <pre>
2266     * public class Matricale extends Yerba {
2267     * ....
2268     * }
2269     * </pre>
2270     *
2271     * Note: It does not apply for interface declaration. For interfaces
2272     * declaration, use implements clause in <code>ClassTree</code> for
2273     * changed extends clause. It is a workaround allowing to extends more
2274     * interfaces.
2275     *
2276     * @param node class where the extends clause will be replaced
2277     * @param extendz new extends identifier or member select.
2278     * @return node's copy with new extends clause
2279     */

2280    public ClassTree setExtends(final ClassTree node, final ExpressionTree extendz) {
2281        ClassTree copy = Class(
2282                node.getModifiers(),
2283                node.getSimpleName(),
2284                node.getTypeParameters(),
2285                extendz,
2286                (List JavaDoc<ExpressionTree>) node.getImplementsClause(), // bug
2287
node.getMembers()
2288        );
2289        return copy;
2290    }
2291    
2292    /**
2293     * Replaces initializer in appropriate element. Allowed types for node
2294     * are <code>MethodTree</code> and <code>VariableTree</code>. Initial
2295     * value is available for variables except the parameters. Fields and
2296     * local variables can be passed to the method. In addition to, annotation
2297     * attribute represented by <code>MethodTree</code> is also valid value.
2298     *
2299     * Consider you have declaration:
2300     *
2301     * <pre>
2302     * public static String cedron;
2303     * </pre>
2304     *
2305     * Running following code:
2306     * <pre>
2307     * TreeMaker make = workingCopy.getTreeMaker();
2308     * VariableTree cedron = <i>contains cedron field</i>;
2309     * Literal initialValue = make.Literal("This is a cedron.");
2310     * VariableTree modified = make.setInitialValue(cedron, literal);
2311     * workingCopy.rewrite(matricale, modified);
2312     * </pre>
2313     *
2314     * will result to:
2315     *
2316     * <pre>
2317     * public static String cedron = "This is a cedron.";
2318     * </pre>
2319     *
2320     * @param node replace the initial value in node
2321     * @param initializer new initial value
2322     * @throws java.lang.IllegalArgumentException if the user provides
2323     * illegal <code>node</code>'s kind, i.e. if the provided
2324     * <code>node</code> is neither <code>MethodTree</code> nor
2325     * <code>VariableTree</code>
2326     * @return node's copy with new initializer
2327     */

2328    public <N extends Tree> N setInitialValue(final N node, ExpressionTree initializer) {
2329        switch (node.getKind()) {
2330            case VARIABLE: {
2331                VariableTree t = (VariableTree) node;
2332                N clone = (N) Variable(
2333                    t.getModifiers(),
2334                    t.getName(),
2335                    t.getType(),
2336                    initializer
2337                );
2338                return clone;
2339            }
2340            case METHOD: {
2341                MethodTree t = (MethodTree) node;
2342                N clone = (N) Method(
2343                    t.getModifiers(),
2344                    t.getName(),
2345                    t.getReturnType(),
2346                    t.getTypeParameters(),
2347                    t.getParameters(),
2348                    t.getThrows(),
2349                    t.getBody(),
2350                    initializer
2351                );
2352                return clone;
2353            }
2354            default:
2355                throw new IllegalArgumentException JavaDoc("Invalid kind " + node.getKind());
2356        }
2357    }
2358    
2359    //comment handling:
2360
/**Append a comment to the list of comments attached to a given tree.
2361     *
2362     * @param tree to which comment should added
2363     * @param comment to add
2364     * @param preceding true if preceding comments should be added, false if trailing comments should be added.
2365     *
2366     * @throws IllegalStateException if the method is called outside the runModificationTask
2367     */

2368    public void addComment(Tree tree, Comment comment, boolean preceding) throws IllegalStateException JavaDoc {
2369        insertComment(tree, comment, -1, preceding);
2370    }
2371    
2372    /**Insert a comment to the list of comments attached to a given tree (to a specified position).
2373     *
2374     * @param tree to which comment should added
2375     * @param comment to add
2376     * @param index -1 to add comment to the end of the list or index at which the comment should be added
2377     * @param preceding true if preceding comments should be added, false if trailing comments should be added.
2378     *
2379     * @throws IllegalStateException if the method is called outside the runModificationTask
2380     */

2381    public void insertComment(Tree tree, Comment comment, int index, boolean preceding) throws IllegalStateException JavaDoc {
2382        if (handler == null) {
2383            throw new IllegalStateException JavaDoc("Cannot modify comments outside runModificationTask.");
2384        }
2385        
2386        CommentSet set = handler.getComments(tree);
2387        
2388        if (set == null) {
2389            if (index != 0 && index != (-1))
2390                throw new IllegalArgumentException JavaDoc("Index out of bounds: " + index);
2391            
2392            handler.addComment(tree, comment);
2393            
2394            if (!preceding) {
2395                set = handler.getComments(tree);
2396                
2397                assert set != null;
2398                
2399                set.addTrailingComment(comment);
2400                set.getPrecedingComments().remove(comment);
2401            }
2402        } else {
2403            if (index == (-1)) {
2404                if (preceding)
2405                    set.addPrecedingComment(comment);
2406                else
2407                    set.addTrailingComment(comment);
2408            } else {
2409                List JavaDoc<Comment> comments;
2410                
2411                if (preceding) {
2412                    comments = set.getPrecedingComments();
2413                } else {
2414                    comments = set.getTrailingComments();
2415                }
2416                
2417                if (comments.size() > index) {
2418                    comments.add(index, comment);
2419                } else {
2420                    throw new IllegalArgumentException JavaDoc("Index out of bounds, index=" + index + ", length=" + comments.size());
2421                }
2422            }
2423        }
2424    }
2425    
2426    /**Remove a comment from the list of comments attached to a given tree.
2427     *
2428     * @param tree to which comment should added
2429     * @param index comment to remove
2430     *
2431     * @throws IllegalStateException if the method is called outside the runModificationTask
2432     */

2433    public void removeComment(Tree tree, int index, boolean preceding) throws IllegalStateException JavaDoc {
2434        if (handler == null) {
2435            throw new IllegalStateException JavaDoc("Cannot modify comments outside runModificationTask.");
2436        }
2437        
2438        CommentSet set = handler.getComments(tree);
2439        
2440        if (set == null) {
2441            throw new IllegalArgumentException JavaDoc("Index out of bounds: " + index);
2442        }
2443        
2444        List JavaDoc<Comment> comments;
2445        
2446        if (preceding) {
2447            comments = set.getPrecedingComments();
2448        } else {
2449            comments = set.getTrailingComments();
2450        }
2451        
2452        if (comments.size() > index) {
2453            comments.remove(index);
2454        } else {
2455            throw new IllegalArgumentException JavaDoc("Index out of bounds, index=" + index + ", length=" + comments.size());
2456        }
2457    }
2458
2459    /**
2460     * Creates a new BlockTree for provided <tt>bodyText</tt>.
2461     *
2462     * @param method figures out the scope for attribution.
2463     * @param bodyText text which will be used for method body creation.
2464     * @return a new tree for <tt>bodyText</tt>.
2465     */

2466    public BlockTree createMethodBody(MethodTree method, String JavaDoc bodyText) {
2467        SourcePositions[] positions = new SourcePositions[1];
2468        final TreeUtilities treeUtils = copy.getTreeUtilities();
2469        StatementTree body = treeUtils.parseStatement(bodyText, positions);
2470        assert Tree.Kind.BLOCK == body.getKind() : "Not a statement block!";
2471        Scope scope = copy.getTrees().getScope(TreePath.getPath(copy.getCompilationUnit(), method));
2472        treeUtils.attributeTree(body, scope);
2473        mapComments((BlockTree) body, bodyText, copy, handler);
2474        return (BlockTree) body;
2475    }
2476
2477    /**
2478     * Creates a new MethodTree.
2479     *
2480     * @param modifiers the modifiers of this method.
2481     * @param name the name of the method.
2482     * @param returnType the return type for this method.
2483     * @param typeParameters the list of generic type parameters, or an empty list.
2484     * @param parameters the list of parameters, or an empty list.
2485     * @param throwsList the list of throws clauses, or an empty list.
2486     * @param bodyText the method's code block provided as a plain text
2487     * @param defaultValue the default value, used by annotation types.
2488     * @see com.sun.source.tree.MethodTree
2489     *
2490     */

2491    public MethodTree Method(ModifiersTree modifiers,
2492                      CharSequence JavaDoc name,
2493                      Tree returnType,
2494                      List JavaDoc<? extends TypeParameterTree> typeParameters,
2495                      List JavaDoc<? extends VariableTree> parameters,
2496                      List JavaDoc<? extends ExpressionTree> throwsList,
2497                      String JavaDoc bodyText,
2498                      ExpressionTree defaultValue)
2499    {
2500        SourcePositions[] positions = new SourcePositions[1];
2501        StatementTree body = copy.getTreeUtilities().parseStatement(bodyText, positions);
2502        assert Tree.Kind.BLOCK == body.getKind() : "Not a statement block!";
2503        mapComments((BlockTree) body, bodyText, copy, handler);
2504        return delegate.Method(modifiers, name, returnType, typeParameters, parameters, throwsList, (BlockTree) body, defaultValue);
2505    }
2506    
2507    private void mapComments(BlockTree block, String JavaDoc inputText, WorkingCopy copy, CommentHandler comments) {
2508        final EnumSet JavaDoc<JavaTokenId> nonRelevant = EnumSet.of(
2509                JavaTokenId.LINE_COMMENT,
2510                JavaTokenId.BLOCK_COMMENT,
2511                JavaTokenId.JAVADOC_COMMENT,
2512                JavaTokenId.WHITESPACE
2513            );
2514        TokenSequence<JavaTokenId> seq = TokenHierarchy.create(inputText, JavaTokenId.language()).tokenSequence(JavaTokenId.language());
2515        List JavaDoc<? extends StatementTree> trees = block.getStatements();
2516        SourcePositions pos = copy.getTrees().getSourcePositions();
2517        for (StatementTree statement : trees) {
2518            seq.move((int) pos.getStartPosition(null, statement));
2519            seq.moveNext();
2520            while (seq.movePrevious() && nonRelevant.contains(seq.token().id())) {
2521                switch (seq.token().id()) {
2522                    case LINE_COMMENT:
2523                        comments.addComment(statement, Comment.create(Style.LINE, Query.NOPOS, Query.NOPOS, Query.NOPOS, seq.token().toString()));
2524                        break;
2525                    case BLOCK_COMMENT:
2526                        comments.addComment(statement, Comment.create(Style.BLOCK, Query.NOPOS, Query.NOPOS, Query.NOPOS, seq.token().toString()));
2527                        break;
2528                    case JAVADOC_COMMENT:
2529                        comments.addComment(statement, Comment.create(Style.JAVADOC, Query.NOPOS, Query.NOPOS, Query.NOPOS, seq.token().toString()));
2530                        break;
2531                }
2532            }
2533        }
2534    }
2535    
2536}
2537
Popular Tags