001 /* This file was generated with JastAdd2 (http://jastadd.org) version R20130213 */ 002 package AST; 003 004 import java.util.HashSet; 005 import java.io.File; 006 import java.util.*; 007 import beaver.*; 008 import java.util.ArrayList; 009 import java.util.zip.*; 010 import java.io.*; 011 import java.io.FileNotFoundException; 012 import java.util.Collection; 013 /** 014 * @production Modifiers : {@link ASTNode} ::= <span class="component">{@link Modifier}*</span>; 015 * @ast node 016 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/java.ast:190 017 */ 018 public class Modifiers extends ASTNode<ASTNode> implements Cloneable { 019 /** 020 * @apilevel low-level 021 */ 022 public void flushCache() { 023 } 024 /** 025 * @apilevel internal 026 */ 027 public void flushCollectionCache() { 028 } 029 /** 030 * @apilevel internal 031 */ 032 @SuppressWarnings({"unchecked", "cast"}) 033 public Modifiers clone() throws CloneNotSupportedException { 034 Modifiers node = (Modifiers)super.clone(); 035 node.isPublic_computed = false; 036 node.isPrivate_computed = false; 037 node.isProtected_computed = false; 038 node.isStatic_computed = false; 039 node.isFinal_computed = false; 040 node.isAbstract_computed = false; 041 node.isVolatile_computed = false; 042 node.isTransient_computed = false; 043 node.isStrictfp_computed = false; 044 node.isSynchronized_computed = false; 045 node.isNative_computed = false; 046 node.isSynthetic_computed = false; 047 node.numModifier_String_values = null; 048 node.in$Circle(false); 049 node.is$Final(false); 050 return node; 051 } 052 /** 053 * @apilevel internal 054 */ 055 @SuppressWarnings({"unchecked", "cast"}) 056 public Modifiers copy() { 057 058 try { 059 Modifiers node = (Modifiers) clone(); 060 node.parent = null; 061 if(children != null) 062 node.children = (ASTNode[]) children.clone(); 063 064 return node; 065 } catch (CloneNotSupportedException e) { 066 throw new Error("Error: clone not supported for " + getClass().getName()); 067 } 068 069 }/** 070 * Create a deep copy of the AST subtree at this node. 071 * The copy is dangling, i.e. has no parent. 072 * @return dangling copy of the subtree at this node 073 * @apilevel low-level 074 */ 075 @SuppressWarnings({"unchecked", "cast"}) 076 public Modifiers fullCopy() { 077 078 Modifiers tree = (Modifiers) copy(); 079 if (children != null) { 080 for (int i = 0; i < children.length; ++i) { 081 082 ASTNode child = (ASTNode) children[i]; 083 if(child != null) { 084 child = child.fullCopy(); 085 tree.setChild(child, i); 086 } 087 } 088 } 089 return tree; 090 091 } /** 092 * @ast method 093 * @aspect Modifiers 094 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:314 095 */ 096 public void checkModifiers() { 097 super.checkModifiers(); 098 if(numProtectionModifiers() > 1) 099 error("only one public, protected, private allowed"); 100 if(numModifier("static") > 1) 101 error("only one static allowed"); 102 // 8.4.3.1 103 // 8.4.3.2 104 // 8.1.1.2 105 if(numCompletenessModifiers() > 1) 106 error("only one of final, abstract, volatile allowed"); 107 if(numModifier("synchronized") > 1) 108 error("only one synchronized allowed"); 109 if(numModifier("transient") > 1) 110 error("only one transient allowed"); 111 if(numModifier("native") > 1) 112 error("only one native allowed"); 113 if(numModifier("strictfp") > 1) 114 error("only one strictfp allowed"); 115 116 if(isPublic() && !mayBePublic()) 117 error("modifier public not allowed in this context"); 118 if(isPrivate() && !mayBePrivate()) 119 error("modifier private not allowed in this context"); 120 if(isProtected() && !mayBeProtected()) 121 error("modifier protected not allowed in this context"); 122 if(isStatic() && !mayBeStatic()) 123 error("modifier static not allowed in this context"); 124 if(isFinal() && !mayBeFinal()) 125 error("modifier final not allowed in this context"); 126 if(isAbstract() && !mayBeAbstract()) 127 error("modifier abstract not allowed in this context"); 128 if(isVolatile() && !mayBeVolatile()) 129 error("modifier volatile not allowed in this context"); 130 if(isTransient() && !mayBeTransient()) 131 error("modifier transient not allowed in this context"); 132 if(isStrictfp() && !mayBeStrictfp()) 133 error("modifier strictfp not allowed in this context"); 134 if(isSynchronized() && !mayBeSynchronized()) 135 error("modifier synchronized not allowed in this context"); 136 if(isNative() && !mayBeNative()) 137 error("modifier native not allowed in this context"); 138 } 139 /** 140 * @ast method 141 * @aspect PrettyPrint 142 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:435 143 */ 144 public void toString(StringBuffer s) { 145 for(int i = 0; i < getNumModifier(); i++) { 146 getModifier(i).toString(s); 147 s.append(" "); 148 } 149 } 150 /** 151 * @ast method 152 * @aspect Flags 153 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:11 154 */ 155 156 public static final int ACC_PUBLIC = 0x0001; 157 /** 158 * @ast method 159 * @aspect Flags 160 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:12 161 */ 162 // class field method 163 public static final int ACC_PRIVATE = 0x0002; 164 /** 165 * @ast method 166 * @aspect Flags 167 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:13 168 */ 169 // field method 170 public static final int ACC_PROTECTED = 0x0004; 171 /** 172 * @ast method 173 * @aspect Flags 174 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:14 175 */ 176 // field method 177 public static final int ACC_STATIC = 0x0008; 178 /** 179 * @ast method 180 * @aspect Flags 181 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:15 182 */ 183 // field method 184 public static final int ACC_FINAL = 0x0010; 185 /** 186 * @ast method 187 * @aspect Flags 188 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:16 189 */ 190 // class field method 191 public static final int ACC_SYNCHRONIZED = 0x0020; 192 /** 193 * @ast method 194 * @aspect Flags 195 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:17 196 */ 197 // method 198 public static final int ACC_SUPER = 0x0020; 199 /** 200 * @ast method 201 * @aspect Flags 202 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:18 203 */ 204 // class 205 public static final int ACC_VOLATILE = 0x0040; 206 /** 207 * @ast method 208 * @aspect Flags 209 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:19 210 */ 211 // field 212 public static final int ACC_TRANSIENT = 0x0080; 213 /** 214 * @ast method 215 * @aspect Flags 216 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:20 217 */ 218 // field 219 public static final int ACC_NATIVE = 0x0100; 220 /** 221 * @ast method 222 * @aspect Flags 223 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:21 224 */ 225 // method 226 public static final int ACC_INTERFACE = 0x0200; 227 /** 228 * @ast method 229 * @aspect Flags 230 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:22 231 */ 232 // class 233 public static final int ACC_ABSTRACT = 0x0400; 234 /** 235 * @ast method 236 * @aspect Flags 237 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:23 238 */ 239 // class method 240 public static final int ACC_SYNTHETIC = 0x1000; 241 /** 242 * @ast method 243 * @aspect Flags 244 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Flags.jrag:24 245 */ 246 // field method 247 public static final int ACC_STRICT = 0x0800; 248 /** 249 * @ast method 250 * @aspect AnnotationsCodegen 251 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AnnotationsCodegen.jrag:39 252 */ 253 public void addRuntimeVisibleAnnotationsAttribute(Collection c) { 254 ConstantPool cp = hostType().constantPool(); 255 Collection annotations = runtimeVisibleAnnotations(); 256 if(!annotations.isEmpty()) 257 c.add(new AnnotationsAttribute(cp, annotations, "RuntimeVisibleAnnotations")); 258 } 259 /** 260 * @ast method 261 * @aspect AnnotationsCodegen 262 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AnnotationsCodegen.jrag:47 263 */ 264 public void addRuntimeInvisibleAnnotationsAttribute(Collection c) { 265 ConstantPool cp = hostType().constantPool(); 266 Collection annotations = runtimeInvisibleAnnotations(); 267 if(!annotations.isEmpty()) 268 c.add(new AnnotationsAttribute(cp, annotations, "RuntimeInvisibleAnnotations")); 269 } 270 /** 271 * @ast method 272 * @aspect AnnotationsCodegen 273 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AnnotationsCodegen.jrag:96 274 */ 275 public Collection runtimeVisibleAnnotations() { 276 Collection annotations = new ArrayList(); 277 for(int i = 0; i < getNumModifier(); i++) 278 if(getModifier(i).isRuntimeVisible()) 279 annotations.add(getModifier(i)); 280 return annotations; 281 } 282 /** 283 * @ast method 284 * @aspect AnnotationsCodegen 285 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AnnotationsCodegen.jrag:117 286 */ 287 public Collection runtimeInvisibleAnnotations() { 288 Collection annotations = new ArrayList(); 289 for(int i = 0; i < getNumModifier(); i++) 290 if(getModifier(i).isRuntimeInvisible()) 291 annotations.add(getModifier(i)); 292 return annotations; 293 } 294 /** 295 * @ast method 296 * @aspect AnnotationsCodegen 297 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AnnotationsCodegen.jrag:140 298 */ 299 300 301 // Add ACC_ANNOTATION flag to generated class file 302 public static final int ACC_ANNOTATION = 0x2000; 303 /** 304 * @ast method 305 * @aspect EnumsCodegen 306 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/EnumsCodegen.jrag:12 307 */ 308 309 // add flags to enums 310 public static final int ACC_ENUM = 0x4000; 311 /** 312 * @ast method 313 * @aspect GenericsCodegen 314 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:218 315 */ 316 317 318 public static final int ACC_BRIDGE = 0x0040; 319 /** 320 * @ast method 321 * @aspect VariableArityParametersCodegen 322 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/VariableArityParametersCodegen.jrag:79 323 */ 324 325 326 public static final int ACC_VARARGS = 0x0080; 327 /** 328 * @ast method 329 * 330 */ 331 public Modifiers() { 332 super(); 333 334 335 } 336 /** 337 * Initializes the child array to the correct size. 338 * Initializes List and Opt nta children. 339 * @apilevel internal 340 * @ast method 341 * @ast method 342 * 343 */ 344 public void init$Children() { 345 children = new ASTNode[1]; 346 setChild(new List(), 0); 347 } 348 /** 349 * @ast method 350 * 351 */ 352 public Modifiers(List<Modifier> p0) { 353 setChild(p0, 0); 354 } 355 /** 356 * @apilevel low-level 357 * @ast method 358 * 359 */ 360 protected int numChildren() { 361 return 1; 362 } 363 /** 364 * @apilevel internal 365 * @ast method 366 * 367 */ 368 public boolean mayHaveRewrite() { 369 return false; 370 } 371 /** 372 * Replaces the Modifier list. 373 * @param list The new list node to be used as the Modifier list. 374 * @apilevel high-level 375 * @ast method 376 * 377 */ 378 public void setModifierList(List<Modifier> list) { 379 setChild(list, 0); 380 } 381 /** 382 * Retrieves the number of children in the Modifier list. 383 * @return Number of children in the Modifier list. 384 * @apilevel high-level 385 * @ast method 386 * 387 */ 388 public int getNumModifier() { 389 return getModifierList().getNumChild(); 390 } 391 /** 392 * Retrieves the number of children in the Modifier list. 393 * Calling this method will not trigger rewrites.. 394 * @return Number of children in the Modifier list. 395 * @apilevel low-level 396 * @ast method 397 * 398 */ 399 public int getNumModifierNoTransform() { 400 return getModifierListNoTransform().getNumChildNoTransform(); 401 } 402 /** 403 * Retrieves the element at index {@code i} in the Modifier list.. 404 * @param i Index of the element to return. 405 * @return The element at position {@code i} in the Modifier list. 406 * @apilevel high-level 407 * @ast method 408 * 409 */ 410 @SuppressWarnings({"unchecked", "cast"}) 411 public Modifier getModifier(int i) { 412 return (Modifier)getModifierList().getChild(i); 413 } 414 /** 415 * Append an element to the Modifier list. 416 * @param node The element to append to the Modifier list. 417 * @apilevel high-level 418 * @ast method 419 * 420 */ 421 public void addModifier(Modifier node) { 422 List<Modifier> list = (parent == null || state == null) ? getModifierListNoTransform() : getModifierList(); 423 list.addChild(node); 424 } 425 /** 426 * @apilevel low-level 427 * @ast method 428 * 429 */ 430 public void addModifierNoTransform(Modifier node) { 431 List<Modifier> list = getModifierListNoTransform(); 432 list.addChild(node); 433 } 434 /** 435 * Replaces the Modifier list element at index {@code i} with the new node {@code node}. 436 * @param node The new node to replace the old list element. 437 * @param i The list index of the node to be replaced. 438 * @apilevel high-level 439 * @ast method 440 * 441 */ 442 public void setModifier(Modifier node, int i) { 443 List<Modifier> list = getModifierList(); 444 list.setChild(node, i); 445 } 446 /** 447 * Retrieves the Modifier list. 448 * @return The node representing the Modifier list. 449 * @apilevel high-level 450 * @ast method 451 * 452 */ 453 public List<Modifier> getModifiers() { 454 return getModifierList(); 455 } 456 /** 457 * Retrieves the Modifier list. 458 * <p><em>This method does not invoke AST transformations.</em></p> 459 * @return The node representing the Modifier list. 460 * @apilevel low-level 461 * @ast method 462 * 463 */ 464 public List<Modifier> getModifiersNoTransform() { 465 return getModifierListNoTransform(); 466 } 467 /** 468 * Retrieves the Modifier list. 469 * @return The node representing the Modifier list. 470 * @apilevel high-level 471 * @ast method 472 * 473 */ 474 @SuppressWarnings({"unchecked", "cast"}) 475 public List<Modifier> getModifierList() { 476 List<Modifier> list = (List<Modifier>)getChild(0); 477 list.getNumChild(); 478 return list; 479 } 480 /** 481 * Retrieves the Modifier list. 482 * <p><em>This method does not invoke AST transformations.</em></p> 483 * @return The node representing the Modifier list. 484 * @apilevel low-level 485 * @ast method 486 * 487 */ 488 @SuppressWarnings({"unchecked", "cast"}) 489 public List<Modifier> getModifierListNoTransform() { 490 return (List<Modifier>)getChildNoTransform(0); 491 } 492 /** 493 * @apilevel internal 494 */ 495 protected boolean isPublic_computed = false; 496 /** 497 * @apilevel internal 498 */ 499 protected boolean isPublic_value; 500 /** 501 * @attribute syn 502 * @aspect Modifiers 503 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:372 504 */ 505 @SuppressWarnings({"unchecked", "cast"}) 506 public boolean isPublic() { 507 if(isPublic_computed) { 508 return isPublic_value; 509 } 510 ASTNode$State state = state(); 511 int num = state.boundariesCrossed; 512 boolean isFinal = this.is$Final(); 513 isPublic_value = isPublic_compute(); 514 if(isFinal && num == state().boundariesCrossed){ isPublic_computed = true; } 515 return isPublic_value; 516 } 517 /** 518 * @apilevel internal 519 */ 520 private boolean isPublic_compute() { return numModifier("public") != 0; } 521 /** 522 * @apilevel internal 523 */ 524 protected boolean isPrivate_computed = false; 525 /** 526 * @apilevel internal 527 */ 528 protected boolean isPrivate_value; 529 /** 530 * @attribute syn 531 * @aspect Modifiers 532 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:373 533 */ 534 @SuppressWarnings({"unchecked", "cast"}) 535 public boolean isPrivate() { 536 if(isPrivate_computed) { 537 return isPrivate_value; 538 } 539 ASTNode$State state = state(); 540 int num = state.boundariesCrossed; 541 boolean isFinal = this.is$Final(); 542 isPrivate_value = isPrivate_compute(); 543 if(isFinal && num == state().boundariesCrossed){ isPrivate_computed = true; } 544 return isPrivate_value; 545 } 546 /** 547 * @apilevel internal 548 */ 549 private boolean isPrivate_compute() { return numModifier("private") != 0; } 550 /** 551 * @apilevel internal 552 */ 553 protected boolean isProtected_computed = false; 554 /** 555 * @apilevel internal 556 */ 557 protected boolean isProtected_value; 558 /** 559 * @attribute syn 560 * @aspect Modifiers 561 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:374 562 */ 563 @SuppressWarnings({"unchecked", "cast"}) 564 public boolean isProtected() { 565 if(isProtected_computed) { 566 return isProtected_value; 567 } 568 ASTNode$State state = state(); 569 int num = state.boundariesCrossed; 570 boolean isFinal = this.is$Final(); 571 isProtected_value = isProtected_compute(); 572 if(isFinal && num == state().boundariesCrossed){ isProtected_computed = true; } 573 return isProtected_value; 574 } 575 /** 576 * @apilevel internal 577 */ 578 private boolean isProtected_compute() { return numModifier("protected") != 0; } 579 /** 580 * @apilevel internal 581 */ 582 protected boolean isStatic_computed = false; 583 /** 584 * @apilevel internal 585 */ 586 protected boolean isStatic_value; 587 /** 588 * @attribute syn 589 * @aspect Modifiers 590 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:375 591 */ 592 @SuppressWarnings({"unchecked", "cast"}) 593 public boolean isStatic() { 594 if(isStatic_computed) { 595 return isStatic_value; 596 } 597 ASTNode$State state = state(); 598 int num = state.boundariesCrossed; 599 boolean isFinal = this.is$Final(); 600 isStatic_value = isStatic_compute(); 601 if(isFinal && num == state().boundariesCrossed){ isStatic_computed = true; } 602 return isStatic_value; 603 } 604 /** 605 * @apilevel internal 606 */ 607 private boolean isStatic_compute() { return numModifier("static") != 0; } 608 /** 609 * @apilevel internal 610 */ 611 protected boolean isFinal_computed = false; 612 /** 613 * @apilevel internal 614 */ 615 protected boolean isFinal_value; 616 /** 617 * @attribute syn 618 * @aspect Modifiers 619 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:376 620 */ 621 @SuppressWarnings({"unchecked", "cast"}) 622 public boolean isFinal() { 623 if(isFinal_computed) { 624 return isFinal_value; 625 } 626 ASTNode$State state = state(); 627 int num = state.boundariesCrossed; 628 boolean isFinal = this.is$Final(); 629 isFinal_value = isFinal_compute(); 630 if(isFinal && num == state().boundariesCrossed){ isFinal_computed = true; } 631 return isFinal_value; 632 } 633 /** 634 * @apilevel internal 635 */ 636 private boolean isFinal_compute() { return numModifier("final") != 0; } 637 /** 638 * @apilevel internal 639 */ 640 protected boolean isAbstract_computed = false; 641 /** 642 * @apilevel internal 643 */ 644 protected boolean isAbstract_value; 645 /** 646 * @attribute syn 647 * @aspect Modifiers 648 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:377 649 */ 650 @SuppressWarnings({"unchecked", "cast"}) 651 public boolean isAbstract() { 652 if(isAbstract_computed) { 653 return isAbstract_value; 654 } 655 ASTNode$State state = state(); 656 int num = state.boundariesCrossed; 657 boolean isFinal = this.is$Final(); 658 isAbstract_value = isAbstract_compute(); 659 if(isFinal && num == state().boundariesCrossed){ isAbstract_computed = true; } 660 return isAbstract_value; 661 } 662 /** 663 * @apilevel internal 664 */ 665 private boolean isAbstract_compute() { return numModifier("abstract") != 0; } 666 /** 667 * @apilevel internal 668 */ 669 protected boolean isVolatile_computed = false; 670 /** 671 * @apilevel internal 672 */ 673 protected boolean isVolatile_value; 674 /** 675 * @attribute syn 676 * @aspect Modifiers 677 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:378 678 */ 679 @SuppressWarnings({"unchecked", "cast"}) 680 public boolean isVolatile() { 681 if(isVolatile_computed) { 682 return isVolatile_value; 683 } 684 ASTNode$State state = state(); 685 int num = state.boundariesCrossed; 686 boolean isFinal = this.is$Final(); 687 isVolatile_value = isVolatile_compute(); 688 if(isFinal && num == state().boundariesCrossed){ isVolatile_computed = true; } 689 return isVolatile_value; 690 } 691 /** 692 * @apilevel internal 693 */ 694 private boolean isVolatile_compute() { return numModifier("volatile") != 0; } 695 /** 696 * @apilevel internal 697 */ 698 protected boolean isTransient_computed = false; 699 /** 700 * @apilevel internal 701 */ 702 protected boolean isTransient_value; 703 /** 704 * @attribute syn 705 * @aspect Modifiers 706 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:379 707 */ 708 @SuppressWarnings({"unchecked", "cast"}) 709 public boolean isTransient() { 710 if(isTransient_computed) { 711 return isTransient_value; 712 } 713 ASTNode$State state = state(); 714 int num = state.boundariesCrossed; 715 boolean isFinal = this.is$Final(); 716 isTransient_value = isTransient_compute(); 717 if(isFinal && num == state().boundariesCrossed){ isTransient_computed = true; } 718 return isTransient_value; 719 } 720 /** 721 * @apilevel internal 722 */ 723 private boolean isTransient_compute() { return numModifier("transient") != 0; } 724 /** 725 * @apilevel internal 726 */ 727 protected boolean isStrictfp_computed = false; 728 /** 729 * @apilevel internal 730 */ 731 protected boolean isStrictfp_value; 732 /** 733 * @attribute syn 734 * @aspect Modifiers 735 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:380 736 */ 737 @SuppressWarnings({"unchecked", "cast"}) 738 public boolean isStrictfp() { 739 if(isStrictfp_computed) { 740 return isStrictfp_value; 741 } 742 ASTNode$State state = state(); 743 int num = state.boundariesCrossed; 744 boolean isFinal = this.is$Final(); 745 isStrictfp_value = isStrictfp_compute(); 746 if(isFinal && num == state().boundariesCrossed){ isStrictfp_computed = true; } 747 return isStrictfp_value; 748 } 749 /** 750 * @apilevel internal 751 */ 752 private boolean isStrictfp_compute() { return numModifier("strictfp") != 0; } 753 /** 754 * @apilevel internal 755 */ 756 protected boolean isSynchronized_computed = false; 757 /** 758 * @apilevel internal 759 */ 760 protected boolean isSynchronized_value; 761 /** 762 * @attribute syn 763 * @aspect Modifiers 764 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:381 765 */ 766 @SuppressWarnings({"unchecked", "cast"}) 767 public boolean isSynchronized() { 768 if(isSynchronized_computed) { 769 return isSynchronized_value; 770 } 771 ASTNode$State state = state(); 772 int num = state.boundariesCrossed; 773 boolean isFinal = this.is$Final(); 774 isSynchronized_value = isSynchronized_compute(); 775 if(isFinal && num == state().boundariesCrossed){ isSynchronized_computed = true; } 776 return isSynchronized_value; 777 } 778 /** 779 * @apilevel internal 780 */ 781 private boolean isSynchronized_compute() { return numModifier("synchronized") != 0; } 782 /** 783 * @apilevel internal 784 */ 785 protected boolean isNative_computed = false; 786 /** 787 * @apilevel internal 788 */ 789 protected boolean isNative_value; 790 /** 791 * @attribute syn 792 * @aspect Modifiers 793 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:382 794 */ 795 @SuppressWarnings({"unchecked", "cast"}) 796 public boolean isNative() { 797 if(isNative_computed) { 798 return isNative_value; 799 } 800 ASTNode$State state = state(); 801 int num = state.boundariesCrossed; 802 boolean isFinal = this.is$Final(); 803 isNative_value = isNative_compute(); 804 if(isFinal && num == state().boundariesCrossed){ isNative_computed = true; } 805 return isNative_value; 806 } 807 /** 808 * @apilevel internal 809 */ 810 private boolean isNative_compute() { return numModifier("native") != 0; } 811 /** 812 * @apilevel internal 813 */ 814 protected boolean isSynthetic_computed = false; 815 /** 816 * @apilevel internal 817 */ 818 protected boolean isSynthetic_value; 819 /** 820 * @attribute syn 821 * @aspect Modifiers 822 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:384 823 */ 824 @SuppressWarnings({"unchecked", "cast"}) 825 public boolean isSynthetic() { 826 if(isSynthetic_computed) { 827 return isSynthetic_value; 828 } 829 ASTNode$State state = state(); 830 int num = state.boundariesCrossed; 831 boolean isFinal = this.is$Final(); 832 isSynthetic_value = isSynthetic_compute(); 833 if(isFinal && num == state().boundariesCrossed){ isSynthetic_computed = true; } 834 return isSynthetic_value; 835 } 836 /** 837 * @apilevel internal 838 */ 839 private boolean isSynthetic_compute() { return numModifier("synthetic") != 0; } 840 /** 841 * @attribute syn 842 * @aspect Modifiers 843 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:386 844 */ 845 public int numProtectionModifiers() { 846 ASTNode$State state = state(); 847 try { return numModifier("public") + numModifier("protected") + numModifier("private"); } 848 finally { 849 } 850 } 851 /** 852 * @attribute syn 853 * @aspect Modifiers 854 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:389 855 */ 856 public int numCompletenessModifiers() { 857 ASTNode$State state = state(); 858 try { return numModifier("abstract") + numModifier("final") + numModifier("volatile"); } 859 finally { 860 } 861 } 862 protected java.util.Map numModifier_String_values; 863 /** 864 * @attribute syn 865 * @aspect Modifiers 866 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:392 867 */ 868 @SuppressWarnings({"unchecked", "cast"}) 869 public int numModifier(String name) { 870 Object _parameters = name; 871 if(numModifier_String_values == null) numModifier_String_values = new java.util.HashMap(4); 872 if(numModifier_String_values.containsKey(_parameters)) { 873 return ((Integer)numModifier_String_values.get(_parameters)).intValue(); 874 } 875 ASTNode$State state = state(); 876 int num = state.boundariesCrossed; 877 boolean isFinal = this.is$Final(); 878 int numModifier_String_value = numModifier_compute(name); 879 if(isFinal && num == state().boundariesCrossed){ numModifier_String_values.put(_parameters, Integer.valueOf(numModifier_String_value)); } 880 return numModifier_String_value; 881 } 882 /** 883 * @apilevel internal 884 */ 885 private int numModifier_compute(String name) { 886 int n = 0; 887 for(int i = 0; i < getNumModifier(); i++) { 888 String s = getModifier(i).getID(); 889 if(s.equals(name)) 890 n++; 891 } 892 return n; 893 } 894 /** 895 * @attribute syn 896 * @aspect Annotations 897 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Annotations.jrag:214 898 */ 899 public Annotation annotation(TypeDecl typeDecl) { 900 ASTNode$State state = state(); 901 try { 902 for(int i = 0; i < getNumModifier(); i++) { 903 if(getModifier(i) instanceof Annotation) { 904 Annotation a = (Annotation)getModifier(i); 905 if(a.type() == typeDecl) 906 return a; 907 } 908 } 909 return null; 910 } 911 finally { 912 } 913 } 914 /** 915 * @attribute syn 916 * @aspect Annotations 917 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Annotations.jrag:289 918 */ 919 public boolean hasAnnotationSuppressWarnings(String s) { 920 ASTNode$State state = state(); 921 try { 922 Annotation a = annotation(lookupType("java.lang", "SuppressWarnings")); 923 if(a != null && a.getNumElementValuePair() == 1 && a.getElementValuePair(0).getName().equals("value")) 924 return a.getElementValuePair(0).getElementValue().hasValue(s); 925 return false; 926 } 927 finally { 928 } 929 } 930 /** 931 * @attribute syn 932 * @aspect Annotations 933 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Annotations.jrag:319 934 */ 935 public boolean hasDeprecatedAnnotation() { 936 ASTNode$State state = state(); 937 try { return annotation(lookupType("java.lang", "Deprecated")) != null; } 938 finally { 939 } 940 } 941 /** 942 * @return true if the modifier list includes the SafeVarargs annotation 943 * @attribute syn 944 * @aspect SafeVarargs 945 * @declaredat /home/jesper/svn/JastAddJ/Java7Frontend/SafeVarargs.jrag:49 946 */ 947 public boolean hasAnnotationSafeVarargs() { 948 ASTNode$State state = state(); 949 try { return annotation(lookupType("java.lang", "SafeVarargs")) != null; } 950 finally { 951 } 952 } 953 /** 954 * @attribute inh 955 * @aspect Modifiers 956 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:358 957 */ 958 @SuppressWarnings({"unchecked", "cast"}) 959 public TypeDecl hostType() { 960 ASTNode$State state = state(); 961 TypeDecl hostType_value = getParent().Define_TypeDecl_hostType(this, null); 962 return hostType_value; 963 } 964 /** 965 * @attribute inh 966 * @aspect Modifiers 967 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:360 968 */ 969 @SuppressWarnings({"unchecked", "cast"}) 970 public boolean mayBePublic() { 971 ASTNode$State state = state(); 972 boolean mayBePublic_value = getParent().Define_boolean_mayBePublic(this, null); 973 return mayBePublic_value; 974 } 975 /** 976 * @attribute inh 977 * @aspect Modifiers 978 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:361 979 */ 980 @SuppressWarnings({"unchecked", "cast"}) 981 public boolean mayBePrivate() { 982 ASTNode$State state = state(); 983 boolean mayBePrivate_value = getParent().Define_boolean_mayBePrivate(this, null); 984 return mayBePrivate_value; 985 } 986 /** 987 * @attribute inh 988 * @aspect Modifiers 989 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:362 990 */ 991 @SuppressWarnings({"unchecked", "cast"}) 992 public boolean mayBeProtected() { 993 ASTNode$State state = state(); 994 boolean mayBeProtected_value = getParent().Define_boolean_mayBeProtected(this, null); 995 return mayBeProtected_value; 996 } 997 /** 998 * @attribute inh 999 * @aspect Modifiers 1000 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:363 1001 */ 1002 @SuppressWarnings({"unchecked", "cast"}) 1003 public boolean mayBeStatic() { 1004 ASTNode$State state = state(); 1005 boolean mayBeStatic_value = getParent().Define_boolean_mayBeStatic(this, null); 1006 return mayBeStatic_value; 1007 } 1008 /** 1009 * @attribute inh 1010 * @aspect Modifiers 1011 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:364 1012 */ 1013 @SuppressWarnings({"unchecked", "cast"}) 1014 public boolean mayBeFinal() { 1015 ASTNode$State state = state(); 1016 boolean mayBeFinal_value = getParent().Define_boolean_mayBeFinal(this, null); 1017 return mayBeFinal_value; 1018 } 1019 /** 1020 * @attribute inh 1021 * @aspect Modifiers 1022 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:365 1023 */ 1024 @SuppressWarnings({"unchecked", "cast"}) 1025 public boolean mayBeAbstract() { 1026 ASTNode$State state = state(); 1027 boolean mayBeAbstract_value = getParent().Define_boolean_mayBeAbstract(this, null); 1028 return mayBeAbstract_value; 1029 } 1030 /** 1031 * @attribute inh 1032 * @aspect Modifiers 1033 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:366 1034 */ 1035 @SuppressWarnings({"unchecked", "cast"}) 1036 public boolean mayBeVolatile() { 1037 ASTNode$State state = state(); 1038 boolean mayBeVolatile_value = getParent().Define_boolean_mayBeVolatile(this, null); 1039 return mayBeVolatile_value; 1040 } 1041 /** 1042 * @attribute inh 1043 * @aspect Modifiers 1044 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:367 1045 */ 1046 @SuppressWarnings({"unchecked", "cast"}) 1047 public boolean mayBeTransient() { 1048 ASTNode$State state = state(); 1049 boolean mayBeTransient_value = getParent().Define_boolean_mayBeTransient(this, null); 1050 return mayBeTransient_value; 1051 } 1052 /** 1053 * @attribute inh 1054 * @aspect Modifiers 1055 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:368 1056 */ 1057 @SuppressWarnings({"unchecked", "cast"}) 1058 public boolean mayBeStrictfp() { 1059 ASTNode$State state = state(); 1060 boolean mayBeStrictfp_value = getParent().Define_boolean_mayBeStrictfp(this, null); 1061 return mayBeStrictfp_value; 1062 } 1063 /** 1064 * @attribute inh 1065 * @aspect Modifiers 1066 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:369 1067 */ 1068 @SuppressWarnings({"unchecked", "cast"}) 1069 public boolean mayBeSynchronized() { 1070 ASTNode$State state = state(); 1071 boolean mayBeSynchronized_value = getParent().Define_boolean_mayBeSynchronized(this, null); 1072 return mayBeSynchronized_value; 1073 } 1074 /** 1075 * @attribute inh 1076 * @aspect Modifiers 1077 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:370 1078 */ 1079 @SuppressWarnings({"unchecked", "cast"}) 1080 public boolean mayBeNative() { 1081 ASTNode$State state = state(); 1082 boolean mayBeNative_value = getParent().Define_boolean_mayBeNative(this, null); 1083 return mayBeNative_value; 1084 } 1085 /** 1086 * @attribute inh 1087 * @aspect Annotations 1088 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Annotations.jrag:56 1089 */ 1090 @SuppressWarnings({"unchecked", "cast"}) 1091 public TypeDecl lookupType(String packageName, String typeName) { 1092 ASTNode$State state = state(); 1093 TypeDecl lookupType_String_String_value = getParent().Define_TypeDecl_lookupType(this, null, packageName, typeName); 1094 return lookupType_String_String_value; 1095 } 1096 /** 1097 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Annotations.jrag:424 1098 * @apilevel internal 1099 */ 1100 public Annotation Define_Annotation_lookupAnnotation(ASTNode caller, ASTNode child, TypeDecl typeDecl) { 1101 if(caller == getModifierListNoTransform()) { 1102 int index = caller.getIndexOfChild(child); 1103 { 1104 return annotation(typeDecl); 1105 } 1106 } 1107 else { return getParent().Define_Annotation_lookupAnnotation(this, caller, typeDecl); 1108 } 1109 } 1110 /** 1111 * @apilevel internal 1112 */ 1113 public ASTNode rewriteTo() { 1114 return super.rewriteTo(); 1115 } 1116 }