1 19 package org.netbeans.modules.java.source.engine; 20 21 import com.sun.source.tree.*; 22 import com.sun.source.tree.Tree.Kind; 23 24 import javax.lang.model.element.*; 25 import javax.lang.model.type.*; 26 import javax.tools.JavaFileObject; 27 28 import java.util.List ; 29 import java.util.Set ; 30 31 36 public interface TreeMakerInt { 37 38 45 AnnotationTree Annotation(Tree type, List <? extends ExpressionTree> arguments); 46 47 54 ArrayAccessTree ArrayAccess(ExpressionTree array, ExpressionTree index); 55 56 62 ArrayTypeTree ArrayType(Tree type); 63 64 71 AssertTree Assert(ExpressionTree condition, ExpressionTree detail); 72 73 80 AssignmentTree Assignment(ExpressionTree variable, ExpressionTree expression); 81 82 91 BinaryTree Binary(Kind operator, ExpressionTree left, ExpressionTree right); 92 93 102 BlockTree Block(List <? extends StatementTree> statements, boolean isStatic); 103 104 110 BreakTree Break(CharSequence label); 111 112 119 CaseTree Case(ExpressionTree expression, List <? extends StatementTree> statements); 120 121 128 CatchTree Catch(VariableTree parameter, BlockTree block); 129 130 144 ClassTree Class(ModifiersTree modifiers, 145 CharSequence simpleName, 146 List <? extends TypeParameterTree> typeParameters, 147 Tree extendsClause, 148 List <? extends ExpressionTree> implementsClauses, 149 List <? extends Tree> memberDecls); 150 151 164 ClassTree Interface(ModifiersTree modifiers, 165 CharSequence simpleName, 166 List <? extends TypeParameterTree> typeParameters, 167 List <? extends ExpressionTree> extendsClauses, 168 List <? extends Tree> memberDecls); 169 170 180 ClassTree AnnotationType(ModifiersTree modifiers, 181 CharSequence simpleName, 182 List <? extends Tree> memberDecls); 183 184 196 ClassTree Enum(ModifiersTree modifiers, 197 CharSequence simpleName, 198 List <? extends ExpressionTree> implementsClauses, 199 List <? extends Tree> memberDecls); 200 201 210 211 CompilationUnitTree CompilationUnit(ExpressionTree packageName, 212 List <? extends ImportTree> imports, 213 List <? extends Tree> typeDeclarations, 214 JavaFileObject sourceFile); 215 216 224 CompoundAssignmentTree CompoundAssignment(Kind operator, 225 ExpressionTree variable, 226 ExpressionTree expression); 227 228 238 ConditionalExpressionTree ConditionalExpression(ExpressionTree condition, 239 ExpressionTree trueExpression, 240 ExpressionTree falseExpression); 241 242 248 ContinueTree Continue(CharSequence label); 249 250 256 DoWhileLoopTree DoWhileLoop(ExpressionTree condition, StatementTree statement); 257 258 263 EmptyStatementTree EmptyStatement(); 264 265 273 EnhancedForLoopTree EnhancedForLoop(VariableTree variable, 274 ExpressionTree expression, 275 StatementTree statement); 276 277 283 ErroneousTree Erroneous(List <? extends Tree> errorTrees); 284 285 291 ExpressionStatementTree ExpressionStatement(ExpressionTree expression); 292 293 302 ForLoopTree ForLoop(List <? extends StatementTree> initializer, 303 ExpressionTree condition, 304 List <? extends ExpressionStatementTree> update, 305 StatementTree statement); 306 307 313 IdentifierTree Identifier(CharSequence name); 314 315 322 IdentifierTree Identifier(Element element); 323 324 325 334 IfTree If(ExpressionTree condition, StatementTree thenStatement, StatementTree elseStatement); 335 336 343 ImportTree Import(Tree qualid, boolean importStatic); 344 345 352 InstanceOfTree InstanceOf(ExpressionTree expression, Tree type); 353 354 361 LabeledStatementTree LabeledStatement(CharSequence label, StatementTree statement); 362 363 372 LiteralTree Literal(Object value); 373 374 386 MemberSelectTree MemberSelect(ExpressionTree expression, CharSequence identifier); 387 388 396 MemberSelectTree MemberSelect(ExpressionTree expression, Element element); 397 398 406 MethodInvocationTree MethodInvocation(List <? extends ExpressionTree> typeArguments, 407 ExpressionTree method, 408 List <? extends ExpressionTree> arguments); 409 410 423 MethodTree Method(ModifiersTree modifiers, 424 CharSequence name, 425 Tree returnType, 426 List <? extends TypeParameterTree> typeParameters, 427 List <? extends VariableTree> parameters, 428 List <? extends ExpressionTree> throwsList, 429 BlockTree body, 430 ExpressionTree defaultValue); 431 432 446 MethodTree Method(ModifiersTree modifiers, 447 CharSequence name, 448 Tree returnType, 449 List <? extends TypeParameterTree> typeParameters, 450 List <? extends VariableTree> parameters, 451 List <? extends ExpressionTree> throwsList, 452 BlockTree body, 453 ExpressionTree defaultValue, 454 TypeElement enclosingElement); 455 456 465 MethodTree Method(ExecutableElement element, BlockTree body); 466 467 475 ModifiersTree Modifiers(Set <Modifier> flags, List <? extends AnnotationTree> annotations); 476 477 484 ModifiersTree Modifiers(Set <Modifier> flags); 485 486 492 ModifiersTree Modifiers(long flags, List <? extends AnnotationTree> annotations); 493 494 503 ModifiersTree Modifiers(ModifiersTree oldMods, List <? extends AnnotationTree> annotations); 504 505 513 NewArrayTree NewArray(Tree elemtype, 514 List <? extends ExpressionTree> dimensions, 515 List <? extends ExpressionTree> initializers); 516 517 527 NewClassTree NewClass(ExpressionTree enclosingExpression, 528 List <? extends ExpressionTree> typeArguments, 529 ExpressionTree identifier, 530 List <? extends ExpressionTree> arguments, 531 ClassTree classBody); 532 533 543 RootTree Root(List <CompilationUnitTree> units); 544 545 552 ParameterizedTypeTree ParameterizedType(Tree type, 553 List <? extends ExpressionTree> typeArguments); 554 555 561 ParenthesizedTree Parenthesized(ExpressionTree expression); 562 563 570 PrimitiveTypeTree PrimitiveType(TypeKind typekind); 571 572 577 ExpressionTree QualIdent(Element element); 578 579 584 ExpressionTree QualIdentImpl(Element element); 585 586 592 ReturnTree Return(ExpressionTree expression); 593 594 601 SwitchTree Switch(ExpressionTree expression, List <? extends CaseTree> cases); 602 603 610 SynchronizedTree Synchronized(ExpressionTree expression, BlockTree block); 611 612 618 ThrowTree Throw(ExpressionTree expression); 619 620 628 TryTree Try(BlockTree tryBlock, 629 List <? extends CatchTree> catches, 630 BlockTree finallyBlock); 631 632 638 Tree Type(TypeMirror type); 639 640 647 TypeCastTree TypeCast(Tree type, ExpressionTree expression); 648 649 656 TypeParameterTree TypeParameter(CharSequence name, 657 List <? extends ExpressionTree> bounds); 658 659 667 UnaryTree Unary(Kind operator, ExpressionTree arg); 668 669 678 VariableTree Variable(ModifiersTree modifiers, 679 CharSequence name, 680 Tree type, 681 ExpressionTree initializer); 682 683 693 VariableTree Variable(ModifiersTree modifiers, 694 CharSequence name, 695 Tree type, 696 ExpressionTree initializer, 697 TypeElement enclosingElement); 698 699 707 VariableTree Variable(VariableElement variable, ExpressionTree initializer); 708 709 716 WhileLoopTree WhileLoop(ExpressionTree condition, StatementTree statement); 717 718 725 WildcardTree Wildcard(Kind kind, Tree type); 726 727 737 AnnotationTree addAnnotationAttrValue(AnnotationTree annotation, ExpressionTree attrValue); 738 739 751 AnnotationTree insertAnnotationAttrValue(AnnotationTree annotation, int index, ExpressionTree attrValue); 752 753 762 AnnotationTree removeAnnotationAttrValue(AnnotationTree annotation, ExpressionTree attrValue); 763 764 775 AnnotationTree removeAnnotationAttrValue(AnnotationTree annotation, int index); 776 777 786 BlockTree addBlockStatement(BlockTree block, StatementTree statement); 787 788 800 BlockTree insertBlockStatement(BlockTree block, int index, StatementTree statement); 801 802 811 BlockTree removeBlockStatement(BlockTree block, StatementTree statement); 812 813 824 BlockTree removeBlockStatement(BlockTree block, int index); 825 826 835 CaseTree addCaseStatement(CaseTree kejs, StatementTree statement); 836 837 849 CaseTree insertCaseStatement(CaseTree kejs, int index, StatementTree statement); 850 851 860 CaseTree removeCaseStatement(CaseTree kejs, StatementTree statement); 861 862 873 CaseTree removeCaseStatement(CaseTree kejs, int index); 874 875 917 ClassTree addClassMember(ClassTree clazz, Tree member); 918 919 931 ClassTree insertClassMember(ClassTree clazz, int index, Tree member); 932 933 942 ClassTree removeClassMember(ClassTree clazz, Tree member); 943 944 955 ClassTree removeClassMember(ClassTree clazz, int index); 956 957 965 ClassTree addClassTypeParameter(ClassTree clazz, TypeParameterTree typeParameter); 966 967 979 ClassTree insertClassTypeParameter(ClassTree clazz, int index, TypeParameterTree typeParameter); 980 981 990 ClassTree removeClassTypeParameter(ClassTree clazz, TypeParameterTree typeParameter); 991 992 1003 ClassTree removeClassTypeParameter(ClassTree clazz, int index); 1004 1005 1013 ClassTree addClassImplementsClause(ClassTree clazz, ExpressionTree implementsClause); 1014 1015 1027 ClassTree insertClassImplementsClause(ClassTree clazz, int index, ExpressionTree implementsClause); 1028 1029 1038 ClassTree removeClassImplementsClause(ClassTree clazz, ExpressionTree implementsClause); 1039 1040 1051 ClassTree removeClassImplementsClause(ClassTree clazz, int index); 1052 1053 1062 CompilationUnitTree addCompUnitTypeDecl(CompilationUnitTree compilationUnit, Tree typeDeclaration); 1063 1064 1076 CompilationUnitTree insertCompUnitTypeDecl(CompilationUnitTree compilationUnit, int index, Tree typeDeclaration); 1077 1078 1087 CompilationUnitTree removeCompUnitTypeDecl(CompilationUnitTree compilationUnit, Tree typeDeclaration); 1088 1089 1100 CompilationUnitTree removeCompUnitTypeDecl(CompilationUnitTree compilationUnit, int index); 1101 1102 1109 public CompilationUnitTree addCompUnitImport(CompilationUnitTree compilationUnit, ImportTree importt); 1110 1111 1123 public CompilationUnitTree insertCompUnitImport(CompilationUnitTree compilationUnit, int index, ImportTree importt); 1124 1125 1134 public CompilationUnitTree removeCompUnitImport(CompilationUnitTree compilationUnit, ImportTree importt); 1135 1136 1147 public CompilationUnitTree removeCompUnitImport(CompilationUnitTree compilationUnit, int index); 1148 1149 1150 1151 1160 ForLoopTree addForLoopInitializer(ForLoopTree forLoop, StatementTree initializer); 1161 1162 1174 ForLoopTree insertForLoopInitializer(ForLoopTree forLoop, int index, StatementTree initializer); 1175 1176 1185 ForLoopTree removeForLoopInitializer(ForLoopTree forLoop, StatementTree initializer); 1186 1187 1198 ForLoopTree removeForLoopInitializer(ForLoopTree forLoop, int index); 1199 1200 1209 ForLoopTree addForLoopUpdate(ForLoopTree forLoop, ExpressionStatementTree update); 1210 1211 1223 ForLoopTree insertForLoopUpdate(ForLoopTree forLoop, int index, ExpressionStatementTree update); 1224 1225 1234 ForLoopTree removeForLoopUpdate(ForLoopTree forLoop, ExpressionStatementTree update); 1235 1236 1247 ForLoopTree removeForLoopUpdate(ForLoopTree forLoop, int index); 1248 1249 1259 MethodInvocationTree addMethodInvocationArgument(MethodInvocationTree methodInvocation, ExpressionTree argument, ExpressionTree typeArgument); 1260 1261 1274 MethodInvocationTree insertMethodInvocationArgument(MethodInvocationTree methodInvocation, int index, ExpressionTree argument, ExpressionTree typeArgument); 1275 1276 1287 MethodInvocationTree removeMethodInvocationArgument(MethodInvocationTree methodInvocation, ExpressionTree argument, ExpressionTree typeArgument); 1288 1289 1300 MethodInvocationTree removeMethodInvocationArgument(MethodInvocationTree methodInvocation, int index); 1301 1302 1311 MethodTree addMethodParameter(MethodTree method, VariableTree parameter); 1312 1313 1325 MethodTree insertMethodParameter(MethodTree method, int index, VariableTree parameter); 1326 1327 1336 MethodTree removeMethodParameter(MethodTree method, VariableTree parameter); 1337 1338 1349 MethodTree removeMethodParameter(MethodTree method, int index); 1350 1351 1359 MethodTree addMethodTypeParameter(MethodTree method, TypeParameterTree typeParameter); 1360 1361 1373 MethodTree insertMethodTypeParameter(MethodTree method, int index, TypeParameterTree typeParameter); 1374 1375 1384 MethodTree removeMethodTypeParameter(MethodTree method, TypeParameterTree typeParameter); 1385 1386 1397 MethodTree removeMethodTypeParameter(MethodTree method, int index); 1398 1399 1407 MethodTree addMethodThrows(MethodTree method, ExpressionTree throwz); 1408 1409 1421 MethodTree insertMethodThrows(MethodTree method, int index, ExpressionTree throwz); 1422 1423 1432 MethodTree removeMethodThrows(MethodTree method, ExpressionTree throwz); 1433 1434 1445 MethodTree removeMethodThrows(MethodTree method, int index); 1446 1447 1456 ModifiersTree addModifiersAnnotation(ModifiersTree modifiers, AnnotationTree annotation); 1457 1458 1470 ModifiersTree insertModifiersAnnotation(ModifiersTree modifiers, int index, AnnotationTree annotation); 1471 1472 1481 ModifiersTree removeModifiersAnnotation(ModifiersTree modifiers, AnnotationTree annotation); 1482 1483 1494 ModifiersTree removeModifiersAnnotation(ModifiersTree modifiers, int index); 1495 1496 1505 NewArrayTree addNewArrayDimension(NewArrayTree newArray, ExpressionTree dimension); 1506 1507 1519 NewArrayTree insertNewArrayDimension(NewArrayTree newArray, int index, ExpressionTree dimension); 1520 1521 1530 NewArrayTree removeNewArrayDimension(NewArrayTree newArray, ExpressionTree dimension); 1531 1532 1543 NewArrayTree removeNewArrayDimension(NewArrayTree newArray, int index); 1544 1545 1554 NewArrayTree addNewArrayInitializer(NewArrayTree newArray, ExpressionTree initializer); 1555 1556 1568 NewArrayTree insertNewArrayInitializer(NewArrayTree newArray, int index, ExpressionTree initializer); 1569 1570 1579 NewArrayTree removeNewArrayInitializer(NewArrayTree newArray, ExpressionTree initializer); 1580 1581 1592 NewArrayTree removeNewArrayInitializer(NewArrayTree newArray, int index); 1593 1594 1604 NewClassTree addNewClassArgument(NewClassTree newClass, ExpressionTree typeArgument, ExpressionTree argument); 1605 1606 1619 NewClassTree insertNewClassArgument(NewClassTree newClass, int index, ExpressionTree typeArgument, ExpressionTree argument); 1620 1621 1632 NewClassTree removeNewClassArgument(NewClassTree newClass, ExpressionTree typeArgument, ExpressionTree argument); 1633 1634 1645 NewClassTree removeNewClassArgument(NewClassTree newClass, int index); 1646 1647 1656 ParameterizedTypeTree addParameterizedTypeTypeArgument(ParameterizedTypeTree parameterizedType, ExpressionTree argument); 1657 1658 1670 ParameterizedTypeTree insertParameterizedTypeTypeArgument(ParameterizedTypeTree parameterizedType, int index, ExpressionTree argument); 1671 1672 1681 ParameterizedTypeTree removeParameterizedTypeTypeArgument(ParameterizedTypeTree parameterizedType, ExpressionTree argument); 1682 1683 1694 ParameterizedTypeTree removeParameterizedTypeTypeArgument(ParameterizedTypeTree parameterizedType, int index); 1695 1696 1705 SwitchTree addSwitchCase(SwitchTree swic, CaseTree kejs); 1706 1707 1719 SwitchTree insertSwitchCase(SwitchTree swic, int index, CaseTree kejs); 1720 1721 1730 SwitchTree removeSwitchCase(SwitchTree swic, CaseTree kejs); 1731 1732 1743 SwitchTree removeSwitchCase(SwitchTree swic, int index); 1744 1745 1754 TryTree addTryCatch(TryTree traj, CatchTree kec); 1755 1756 1768 TryTree insertTryCatch(TryTree traj, int index, CatchTree kec); 1769 1770 1779 TryTree removeTryCatch(TryTree traj, CatchTree kec); 1780 1781 1792 TryTree removeTryCatch(TryTree traj, int index); 1793 1794 1802 TypeParameterTree addTypeParameterBound(TypeParameterTree typeParameter, ExpressionTree bound); 1803 1804 1816 TypeParameterTree insertTypeParameterBound(TypeParameterTree typeParameter, int index, ExpressionTree bound); 1817 1818 1827 TypeParameterTree removeTypeParameterBound(TypeParameterTree typeParameter, ExpressionTree bound); 1828 1829 1840 TypeParameterTree removeTypeParameterBound(TypeParameterTree typeParameter, int index); 1841 1842 1880 <N extends Tree> N setLabel(final N node, final CharSequence aLabel) 1881 throws IllegalArgumentException ; 1882} 1883 | Popular Tags |