1/* 2 * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 * of Java bytecode. 4 * 5 * Copyright (c) 2002-2009 Eric Lafortune (eric@graphics.cornell.edu) 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the Free 9 * Software Foundation; either version 2 of the License, or (at your option) 10 * any later version. 11 * 12 * This program is distributed in the hope that it will be useful, but WITHOUT 13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 15 * more details. 16 * 17 * You should have received a copy of the GNU General Public License along 18 * with this program; if not, write to the Free Software Foundation, Inc., 19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 */ 21package proguard.classfile.util; 22 23import proguard.classfile.*; 24import proguard.classfile.attribute.*; 25import proguard.classfile.attribute.annotation.*; 26import proguard.classfile.attribute.preverification.*; 27import proguard.classfile.constant.*; 28import proguard.classfile.instruction.*; 29 30/** 31 * This abstract utility class allows to implement various visitor interfaces 32 * with simplified methods. The provided methods delegate to other versions 33 * with fewer arguments or more general arguments. 34 * 35 * @author Eric Lafortune 36 * @noinspection AbstractClassWithoutAbstractMethods 37 */ 38public abstract class SimplifiedVisitor 39{ 40 // Simplifications for ClassVisitor. 41 42 /** 43 * Visits any type of class member of the given class. 44 */ 45 public void visitAnyClass(Clazz Clazz) 46 { 47 throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 48 } 49 50 51 public void visitProgramClass(ProgramClass programClass) 52 { 53 visitAnyClass(programClass); 54 } 55 56 57 public void visitLibraryClass(LibraryClass libraryClass) 58 { 59 visitAnyClass(libraryClass); 60 } 61 62 63 // Simplifications for MemberVisitor. 64 65 /** 66 * Visits any type of class member of the given class. 67 */ 68 public void visitAnyMember(Clazz clazz, Member member) 69 { 70 throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 71 } 72 73 74 /** 75 * Visits any type of class member of the given program class. 76 */ 77 public void visitProgramMember(ProgramClass programClass, ProgramMember programMember) 78 { 79 visitAnyMember(programClass, programMember); 80 } 81 82 83 public void visitProgramField(ProgramClass programClass, ProgramField programField) 84 { 85 visitProgramMember(programClass, programField); 86 } 87 88 89 public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) 90 { 91 visitProgramMember(programClass, programMethod); 92 } 93 94 95 /** 96 * Visits any type of class member of the given library class. 97 */ 98 public void visitLibraryMember(LibraryClass libraryClass, LibraryMember libraryMember) 99 { 100 visitAnyMember(libraryClass, libraryMember); 101 } 102 103 104 public void visitLibraryField(LibraryClass libraryClass, LibraryField libraryField) 105 { 106 visitLibraryMember(libraryClass, libraryField); 107 } 108 109 110 public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod) 111 { 112 visitLibraryMember(libraryClass, libraryMethod); 113 } 114 115 116 // Simplifications for ConstantVisitor. 117 118 public void visitAnyConstant(Clazz clazz, Constant constant) 119 { 120 throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 121 } 122 123 124 public void visitIntegerConstant(Clazz clazz, IntegerConstant integerConstant) 125 { 126 visitAnyConstant(clazz, integerConstant); 127 } 128 129 130 public void visitLongConstant(Clazz clazz, LongConstant longConstant) 131 { 132 visitAnyConstant(clazz, longConstant); 133 } 134 135 136 public void visitFloatConstant(Clazz clazz, FloatConstant floatConstant) 137 { 138 visitAnyConstant(clazz, floatConstant); 139 } 140 141 142 public void visitDoubleConstant(Clazz clazz, DoubleConstant doubleConstant) 143 { 144 visitAnyConstant(clazz, doubleConstant); 145 } 146 147 148 public void visitStringConstant(Clazz clazz, StringConstant stringConstant) 149 { 150 visitAnyConstant(clazz, stringConstant); 151 } 152 153 154 public void visitUtf8Constant(Clazz clazz, Utf8Constant utf8Constant) 155 { 156 visitAnyConstant(clazz, utf8Constant); 157 } 158 159 160 /** 161 * Visits any type of RefConstant of the given class. 162 */ 163 public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant) 164 { 165 visitAnyConstant(clazz, refConstant); 166 } 167 168 169 public void visitFieldrefConstant(Clazz clazz, FieldrefConstant fieldrefConstant) 170 { 171 visitAnyRefConstant(clazz, fieldrefConstant); 172 } 173 174 175 /** 176 * Visits any type of method RefConstant of the given class. 177 */ 178 public void visitAnyMethodrefConstant(Clazz clazz, RefConstant refConstant) 179 { 180 visitAnyRefConstant(clazz, refConstant); 181 } 182 183 184 public void visitInterfaceMethodrefConstant(Clazz clazz, InterfaceMethodrefConstant interfaceMethodrefConstant) 185 { 186 visitAnyMethodrefConstant(clazz, interfaceMethodrefConstant); 187 } 188 189 190 public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant) 191 { 192 visitAnyMethodrefConstant(clazz, methodrefConstant); 193 } 194 195 196 public void visitClassConstant(Clazz clazz, ClassConstant classConstant) 197 { 198 visitAnyConstant(clazz, classConstant); 199 } 200 201 202 public void visitNameAndTypeConstant(Clazz clazz, NameAndTypeConstant nameAndTypeConstant) 203 { 204 visitAnyConstant(clazz, nameAndTypeConstant); 205 } 206 207 208 // Simplifications for AttributeVisitor. 209 210 /** 211 * Visit any type of attribute. 212 */ 213 public void visitAnyAttribute(Clazz clazz, Attribute attribute) 214 { 215 throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 216 } 217 218 219 public void visitUnknownAttribute(Clazz clazz, UnknownAttribute unknownAttribute) 220 { 221 visitAnyAttribute(clazz, unknownAttribute); 222 } 223 224 225 public void visitSourceFileAttribute(Clazz clazz, SourceFileAttribute sourceFileAttribute) 226 { 227 visitAnyAttribute(clazz, sourceFileAttribute); 228 } 229 230 231 public void visitSourceDirAttribute(Clazz clazz, SourceDirAttribute sourceDirAttribute) 232 { 233 visitAnyAttribute(clazz, sourceDirAttribute); 234 } 235 236 237 public void visitInnerClassesAttribute(Clazz clazz, InnerClassesAttribute innerClassesAttribute) 238 { 239 visitAnyAttribute(clazz, innerClassesAttribute); 240 } 241 242 243 public void visitEnclosingMethodAttribute(Clazz clazz, EnclosingMethodAttribute enclosingMethodAttribute) 244 { 245 visitAnyAttribute(clazz, enclosingMethodAttribute); 246 } 247 248 249 public void visitDeprecatedAttribute(Clazz clazz, DeprecatedAttribute deprecatedAttribute) 250 { 251 visitAnyAttribute(clazz, deprecatedAttribute); 252 } 253 254 255 /** 256 * Visits the given DeprecatedAttribute of any type of class member. 257 */ 258 public void visitDeprecatedAttribute(Clazz clazz, Member member, DeprecatedAttribute deprecatedAttribute) 259 { 260 visitDeprecatedAttribute(clazz, deprecatedAttribute); 261 } 262 263 264 public void visitDeprecatedAttribute(Clazz clazz, Field field, DeprecatedAttribute deprecatedAttribute) 265 { 266 visitDeprecatedAttribute(clazz, (Member)field, deprecatedAttribute); 267 } 268 269 270 public void visitDeprecatedAttribute(Clazz clazz, Method method, DeprecatedAttribute deprecatedAttribute) 271 { 272 visitDeprecatedAttribute(clazz, (Member)method, deprecatedAttribute); 273 } 274 275 276 public void visitSyntheticAttribute(Clazz clazz, SyntheticAttribute syntheticAttribute) 277 { 278 visitAnyAttribute(clazz, syntheticAttribute); 279 } 280 281 282 /** 283 * Visits the given SyntheticAttribute of any type of class member. 284 */ 285 public void visitSyntheticAttribute(Clazz clazz, Member member, SyntheticAttribute syntheticAttribute) 286 { 287 visitSyntheticAttribute(clazz, syntheticAttribute); 288 } 289 290 291 public void visitSyntheticAttribute(Clazz clazz, Field field, SyntheticAttribute syntheticAttribute) 292 { 293 visitSyntheticAttribute(clazz, (Member)field, syntheticAttribute); 294 } 295 296 297 public void visitSyntheticAttribute(Clazz clazz, Method method, SyntheticAttribute syntheticAttribute) 298 { 299 visitSyntheticAttribute(clazz, (Member)method, syntheticAttribute); 300 } 301 302 303 public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute) 304 { 305 visitAnyAttribute(clazz, signatureAttribute); 306 } 307 308 309 /** 310 * Visits the given SignatureAttribute of any type of class member. 311 */ 312 public void visitSignatureAttribute(Clazz clazz, Member member, SignatureAttribute signatureAttribute) 313 { 314 visitSignatureAttribute(clazz, signatureAttribute); 315 } 316 317 318 public void visitSignatureAttribute(Clazz clazz, Field field, SignatureAttribute signatureAttribute) 319 { 320 visitSignatureAttribute(clazz, (Member)field, signatureAttribute); 321 } 322 323 324 public void visitSignatureAttribute(Clazz clazz, Method method, SignatureAttribute signatureAttribute) 325 { 326 visitSignatureAttribute(clazz, (Member)method, signatureAttribute); 327 } 328 329 330 public void visitConstantValueAttribute(Clazz clazz, Field field, ConstantValueAttribute constantValueAttribute) 331 { 332 visitAnyAttribute(clazz, constantValueAttribute); 333 } 334 335 336 public void visitExceptionsAttribute(Clazz clazz, Method method, ExceptionsAttribute exceptionsAttribute) 337 { 338 visitAnyAttribute(clazz, exceptionsAttribute); 339 } 340 341 342 public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) 343 { 344 visitAnyAttribute(clazz, codeAttribute); 345 } 346 347 348 public void visitStackMapAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapAttribute stackMapAttribute) 349 { 350 visitAnyAttribute(clazz, stackMapAttribute); 351 } 352 353 354 public void visitStackMapTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapTableAttribute stackMapTableAttribute) 355 { 356 visitAnyAttribute(clazz, stackMapTableAttribute); 357 } 358 359 360 public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute) 361 { 362 visitAnyAttribute(clazz, lineNumberTableAttribute); 363 } 364 365 366 public void visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute) 367 { 368 visitAnyAttribute(clazz, localVariableTableAttribute); 369 } 370 371 372 public void visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute) 373 { 374 visitAnyAttribute(clazz, localVariableTypeTableAttribute); 375 } 376 377 378 /** 379 * Visits any type of AnnotationsAttribute of a class. 380 */ 381 public void visitAnyAnnotationsAttribute(Clazz clazz, AnnotationsAttribute annotationsAttribute) 382 { 383 visitAnyAttribute(clazz, annotationsAttribute); 384 } 385 386 387 public void visitRuntimeVisibleAnnotationsAttribute(Clazz clazz, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute) 388 { 389 visitAnyAnnotationsAttribute(clazz, runtimeVisibleAnnotationsAttribute); 390 } 391 392 393 /** 394 * Visits the given RuntimeVisibleAnnotationsAttribute of any type of class member. 395 */ 396 public void visitRuntimeVisibleAnnotationsAttribute(Clazz clazz, Member member, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute) 397 { 398 visitRuntimeVisibleAnnotationsAttribute(clazz, runtimeVisibleAnnotationsAttribute); 399 } 400 401 402 public void visitRuntimeVisibleAnnotationsAttribute(Clazz clazz, Field field, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute) 403 { 404 visitRuntimeVisibleAnnotationsAttribute(clazz, (Member)field, runtimeVisibleAnnotationsAttribute); 405 } 406 407 408 public void visitRuntimeVisibleAnnotationsAttribute(Clazz clazz, Method method, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute) 409 { 410 visitRuntimeVisibleAnnotationsAttribute(clazz, (Member)method, runtimeVisibleAnnotationsAttribute); 411 } 412 413 414 public void visitRuntimeInvisibleAnnotationsAttribute(Clazz clazz, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute) 415 { 416 visitAnyAnnotationsAttribute(clazz, runtimeInvisibleAnnotationsAttribute); 417 } 418 419 420 /** 421 * Visits the given RuntimeInvisibleAnnotationsAttribute of any type of class member. 422 */ 423 public void visitRuntimeInvisibleAnnotationsAttribute(Clazz clazz, Member member, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute) 424 { 425 visitRuntimeInvisibleAnnotationsAttribute(clazz, runtimeInvisibleAnnotationsAttribute); 426 } 427 428 429 public void visitRuntimeInvisibleAnnotationsAttribute(Clazz clazz, Field field, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute) 430 { 431 visitRuntimeInvisibleAnnotationsAttribute(clazz, (Member)field, runtimeInvisibleAnnotationsAttribute); 432 } 433 434 435 public void visitRuntimeInvisibleAnnotationsAttribute(Clazz clazz, Method method, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute) 436 { 437 visitRuntimeInvisibleAnnotationsAttribute(clazz, (Member)method, runtimeInvisibleAnnotationsAttribute); 438 } 439 440 441 /** 442 * Visits any type of ParameterAnnotationsAttribute. 443 */ 444 public void visitAnyParameterAnnotationsAttribute(Clazz clazz, Method method, ParameterAnnotationsAttribute parameterAnnotationsAttribute) 445 { 446 visitAnyAttribute(clazz, parameterAnnotationsAttribute); 447 } 448 449 450 public void visitRuntimeVisibleParameterAnnotationsAttribute(Clazz clazz, Method method, RuntimeVisibleParameterAnnotationsAttribute runtimeVisibleParameterAnnotationsAttribute) 451 { 452 visitAnyParameterAnnotationsAttribute(clazz, method, runtimeVisibleParameterAnnotationsAttribute); 453 } 454 455 456 public void visitRuntimeInvisibleParameterAnnotationsAttribute(Clazz clazz, Method method, RuntimeInvisibleParameterAnnotationsAttribute runtimeInvisibleParameterAnnotationsAttribute) 457 { 458 visitAnyParameterAnnotationsAttribute(clazz, method, runtimeInvisibleParameterAnnotationsAttribute); 459 } 460 461 462 public void visitAnnotationDefaultAttribute(Clazz clazz, Method method, AnnotationDefaultAttribute annotationDefaultAttribute) 463 { 464 visitAnyAttribute(clazz, annotationDefaultAttribute); 465 } 466 467 468 // Simplifications for InstructionVisitor. 469 470 /** 471 * Visits any type of Instruction. 472 */ 473 public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) 474 { 475 throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 476 } 477 478 479 public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction) 480 { 481 visitAnyInstruction(clazz, method, codeAttribute, offset, simpleInstruction); 482 } 483 484 485 public void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction) 486 { 487 visitAnyInstruction(clazz, method, codeAttribute, offset, variableInstruction); 488 } 489 490 491 public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) 492 { 493 visitAnyInstruction(clazz, method, codeAttribute, offset, constantInstruction); 494 } 495 496 497 public void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction) 498 { 499 visitAnyInstruction(clazz, method, codeAttribute, offset, branchInstruction); 500 } 501 502 503 /** 504 * Visits either type of SwitchInstruction. 505 */ 506 public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) 507 { 508 visitAnyInstruction(clazz, method, codeAttribute, offset, switchInstruction); 509 } 510 511 512 public void visitTableSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TableSwitchInstruction tableSwitchInstruction) 513 { 514 visitAnySwitchInstruction(clazz, method, codeAttribute, offset, tableSwitchInstruction); 515 } 516 517 518 public void visitLookUpSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LookUpSwitchInstruction lookUpSwitchInstruction) 519 { 520 visitAnySwitchInstruction(clazz, method, codeAttribute, offset, lookUpSwitchInstruction); 521 } 522 523 524 // Simplifications for StackMapFrameVisitor. 525 526 /** 527 * Visits any type of VerificationType. 528 */ 529 public void visitAnyStackMapFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, StackMapFrame stackMapFrame) 530 { 531 throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 532 } 533 534 535 public void visitSameZeroFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SameZeroFrame sameZeroFrame) 536 { 537 visitAnyStackMapFrame(clazz, method, codeAttribute, offset, sameZeroFrame); 538 } 539 540 541 public void visitSameOneFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SameOneFrame sameOneFrame) 542 { 543 visitAnyStackMapFrame(clazz, method, codeAttribute, offset, sameOneFrame); 544 } 545 546 547 public void visitLessZeroFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LessZeroFrame lessZeroFrame) 548 { 549 visitAnyStackMapFrame(clazz, method, codeAttribute, offset, lessZeroFrame); 550 } 551 552 553 public void visitMoreZeroFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, MoreZeroFrame moreZeroFrame) 554 { 555 visitAnyStackMapFrame(clazz, method, codeAttribute, offset, moreZeroFrame); 556 } 557 558 559 public void visitFullFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, FullFrame fullFrame) 560 { 561 visitAnyStackMapFrame(clazz, method, codeAttribute, offset, fullFrame); 562 } 563 564 565 // Simplifications for VerificationTypeVisitor. 566 567 /** 568 * Visits any type of VerificationType. 569 */ 570 public void visitAnyVerificationType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VerificationType verificationType) 571 { 572 throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 573 } 574 575 576 public void visitIntegerType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, IntegerType integerType) 577 { 578 visitAnyVerificationType(clazz, method, codeAttribute, offset, integerType); 579 } 580 581 582 public void visitFloatType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, FloatType floatType) 583 { 584 visitAnyVerificationType(clazz, method, codeAttribute, offset, floatType); 585 } 586 587 588 public void visitLongType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LongType longType) 589 { 590 visitAnyVerificationType(clazz, method, codeAttribute, offset, longType); 591 } 592 593 594 public void visitDoubleType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, DoubleType doubleType) 595 { 596 visitAnyVerificationType(clazz, method, codeAttribute, offset, doubleType); 597 } 598 599 600 public void visitTopType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TopType topType) 601 { 602 visitAnyVerificationType(clazz, method, codeAttribute, offset, topType); 603 } 604 605 606 public void visitObjectType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ObjectType objectType) 607 { 608 visitAnyVerificationType(clazz, method, codeAttribute, offset, objectType); 609 } 610 611 612 public void visitNullType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, NullType nullType) 613 { 614 visitAnyVerificationType(clazz, method, codeAttribute, offset, nullType); 615 } 616 617 618 public void visitUninitializedType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, UninitializedType uninitializedType) 619 { 620 visitAnyVerificationType(clazz, method, codeAttribute, offset, uninitializedType); 621 } 622 623 624 public void visitUninitializedThisType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, UninitializedThisType uninitializedThisType) 625 { 626 visitAnyVerificationType(clazz, method, codeAttribute, offset, uninitializedThisType); 627 } 628 629 630 public void visitStackIntegerType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, IntegerType integerType) 631 { 632 visitIntegerType(clazz, method, codeAttribute, offset, integerType); 633 } 634 635 636 public void visitStackFloatType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, FloatType floatType) 637 { 638 visitFloatType(clazz, method, codeAttribute, offset, floatType); 639 } 640 641 642 public void visitStackLongType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, LongType longType) 643 { 644 visitLongType(clazz, method, codeAttribute, offset, longType); 645 } 646 647 648 public void visitStackDoubleType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, DoubleType doubleType) 649 { 650 visitDoubleType(clazz, method, codeAttribute, offset, doubleType); 651 } 652 653 654 public void visitStackTopType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, TopType topType) 655 { 656 visitTopType(clazz, method, codeAttribute, offset, topType); 657 } 658 659 660 public void visitStackObjectType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, ObjectType objectType) 661 { 662 visitObjectType(clazz, method, codeAttribute, offset, objectType); 663 } 664 665 666 public void visitStackNullType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, NullType nullType) 667 { 668 visitNullType(clazz, method, codeAttribute, offset, nullType); 669 } 670 671 672 public void visitStackUninitializedType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, UninitializedType uninitializedType) 673 { 674 visitUninitializedType(clazz, method, codeAttribute, offset, uninitializedType); 675 } 676 677 678 public void visitStackUninitializedThisType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, UninitializedThisType uninitializedThisType) 679 { 680 visitUninitializedThisType(clazz, method, codeAttribute, offset, uninitializedThisType); 681 } 682 683 684 685 public void visitVariablesIntegerType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, IntegerType integerType) 686 { 687 visitIntegerType(clazz, method, codeAttribute, offset, integerType); 688 } 689 690 691 public void visitVariablesFloatType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, FloatType floatType) 692 { 693 visitFloatType(clazz, method, codeAttribute, offset, floatType); 694 } 695 696 697 public void visitVariablesLongType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, LongType longType) 698 { 699 visitLongType(clazz, method, codeAttribute, offset, longType); 700 } 701 702 703 public void visitVariablesDoubleType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, DoubleType doubleType) 704 { 705 visitDoubleType(clazz, method, codeAttribute, offset, doubleType); 706 } 707 708 709 public void visitVariablesTopType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, TopType topType) 710 { 711 visitTopType(clazz, method, codeAttribute, offset, topType); 712 } 713 714 715 public void visitVariablesObjectType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, ObjectType objectType) 716 { 717 visitObjectType(clazz, method, codeAttribute, offset, objectType); 718 } 719 720 721 public void visitVariablesNullType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, NullType nullType) 722 { 723 visitNullType(clazz, method, codeAttribute, offset, nullType); 724 } 725 726 727 public void visitVariablesUninitializedType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, UninitializedType uninitializedType) 728 { 729 visitUninitializedType(clazz, method, codeAttribute, offset, uninitializedType); 730 } 731 732 733 public void visitVariablesUninitializedThisType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int index, UninitializedThisType uninitializedThisType) 734 { 735 visitUninitializedThisType(clazz, method, codeAttribute, offset, uninitializedThisType); 736 } 737 738 739 // Simplifications for AnnotationVisitor. 740 741 public void visitAnnotation(Clazz clazz, Annotation annotation) 742 { 743 throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 744 } 745 746 747 /** 748 * Visits the given Annotation of any type of class member. 749 */ 750 public void visitAnnotation(Clazz clazz, Member member, Annotation annotation) 751 { 752 visitAnnotation(clazz, annotation); 753 } 754 755 756 public void visitAnnotation(Clazz clazz, Field field, Annotation annotation) 757 { 758 visitAnnotation(clazz, (Member)field, annotation); 759 } 760 761 762 public void visitAnnotation(Clazz clazz, Method method, Annotation annotation) 763 { 764 visitAnnotation(clazz, (Member)method, annotation); 765 } 766 767 768 public void visitAnnotation(Clazz clazz, Method method, int parameterIndex, Annotation annotation) 769 { 770 visitAnnotation(clazz, method, annotation); 771 } 772 773 774 // Simplifications for ElementValueVisitor. 775 776 public void visitAnyElementValue(Clazz clazz, Annotation annotation, ElementValue elementValue) 777 { 778 throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 779 } 780 781 782 public void visitConstantElementValue(Clazz clazz, Annotation annotation, ConstantElementValue constantElementValue) 783 { 784 visitAnyElementValue(clazz, annotation, constantElementValue); 785 } 786 787 788 public void visitEnumConstantElementValue(Clazz clazz, Annotation annotation, EnumConstantElementValue enumConstantElementValue) 789 { 790 visitAnyElementValue(clazz, annotation, enumConstantElementValue); 791 } 792 793 794 public void visitClassElementValue(Clazz clazz, Annotation annotation, ClassElementValue classElementValue) 795 { 796 visitAnyElementValue(clazz, annotation, classElementValue); 797 } 798 799 800 public void visitAnnotationElementValue(Clazz clazz, Annotation annotation, AnnotationElementValue annotationElementValue) 801 { 802 visitAnyElementValue(clazz, annotation, annotationElementValue); 803 } 804 805 806 public void visitArrayElementValue(Clazz clazz, Annotation annotation, ArrayElementValue arrayElementValue) 807 { 808 visitAnyElementValue(clazz, annotation, arrayElementValue); 809 } 810} 811