You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IsAtAspectAnnotationVisitor.java 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* *******************************************************************
  2. * Copyright (c) 2006 Contributors
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * Eugene Kuleshov, Ron Bodkin initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver.tools;
  13. import org.aspectj.org.objectweb.asm.AnnotationVisitor;
  14. import org.aspectj.org.objectweb.asm.Attribute;
  15. import org.aspectj.org.objectweb.asm.ClassVisitor;
  16. import org.aspectj.org.objectweb.asm.FieldVisitor;
  17. import org.aspectj.org.objectweb.asm.Label;
  18. import org.aspectj.org.objectweb.asm.MethodVisitor;
  19. // should extend EmptyVisitor but it's not currently included with AspectJ's ASM...
  20. public class IsAtAspectAnnotationVisitor implements ClassVisitor, FieldVisitor,
  21. MethodVisitor, AnnotationVisitor {
  22. private boolean isAspect = false;
  23. public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
  24. if ("Lorg/aspectj/lang/annotation/Aspect;".equals(desc)) {
  25. isAspect = true;
  26. }
  27. return this;
  28. }
  29. public FieldVisitor visitField(int access, String name, String desc,
  30. String signature, Object value) {
  31. return null;
  32. }
  33. public MethodVisitor visitMethod(int access, String name, String desc,
  34. String signature, String[] exceptions) {
  35. return null;
  36. }
  37. public boolean isAspect() {
  38. return isAspect;
  39. }
  40. public void visit(int version, int access, String name, String signature,
  41. String superName, String[] interfaces) {
  42. }
  43. public void visitSource(String source, String debug) {
  44. }
  45. public void visitOuterClass(String owner, String name, String desc) {
  46. }
  47. public void visitAttribute(Attribute attr) {
  48. }
  49. public void visitInnerClass(String name, String outerName,
  50. String innerName, int access) {
  51. }
  52. public void visitEnd() {
  53. }
  54. public AnnotationVisitor visitAnnotationDefault() {
  55. return this;
  56. }
  57. public AnnotationVisitor visitParameterAnnotation(int parameter,
  58. String desc, boolean visible) {
  59. return this;
  60. }
  61. public void visitCode() {
  62. }
  63. public void visitInsn(int opcode) {
  64. }
  65. public void visitIntInsn(int opcode, int operand) {
  66. }
  67. public void visitVarInsn(int opcode, int var) {
  68. }
  69. public void visitTypeInsn(int opcode, String desc) {
  70. }
  71. public void visitFieldInsn(int opcode, String owner, String name,
  72. String desc) {
  73. }
  74. public void visitMethodInsn(int opcode, String owner, String name,
  75. String desc) {
  76. }
  77. public void visitJumpInsn(int opcode, Label label) {
  78. }
  79. public void visitLabel(Label label) {
  80. }
  81. public void visitLdcInsn(Object cst) {
  82. }
  83. public void visitIincInsn(int var, int increment) {
  84. }
  85. public void visitTableSwitchInsn(int min, int max, Label dflt,
  86. Label labels[]) {
  87. }
  88. public void visitLookupSwitchInsn(Label dflt, int keys[], Label labels[]) {
  89. }
  90. public void visitMultiANewArrayInsn(String desc, int dims) {
  91. }
  92. public void visitTryCatchBlock(Label start, Label end, Label handler,
  93. String type) {
  94. }
  95. public void visitLocalVariable(String name, String desc, String signature,
  96. Label start, Label end, int index) {
  97. }
  98. public void visitLineNumber(int line, Label start) {
  99. }
  100. public void visitMaxs(int maxStack, int maxLocals) {
  101. }
  102. public void visit(String name, Object value) {
  103. }
  104. public void visitEnum(String name, String desc, String value) {
  105. }
  106. public AnnotationVisitor visitAnnotation(String name, String desc) {
  107. return this;
  108. }
  109. public AnnotationVisitor visitArray(String name) {
  110. return this;
  111. }
  112. }