1 4 package com.tc.aspectwerkz.transform.inlining; 5 6 import com.tc.asm.*; 7 8 13 public class AsmNullAdapter { 14 15 20 public static class NullClassAdapter implements ClassVisitor { 21 22 public final static ClassVisitor NULL_CLASS_ADAPTER = new NullClassAdapter(); 23 24 public void visit(int version, int access, String name, String signature, String superName, String [] interfaces) { 25 } 26 27 public void visitInnerClass(String name, String outerName, String innerName, int access) { 28 } 29 30 public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { 31 return NullFieldAdapter.NULL_FIELD_ADAPTER; 32 } 33 34 public MethodVisitor visitMethod(int access, String name, String desc, String signature, String [] exceptions) { 35 return NullMethodAdapter.NULL_METHOD_ADAPTER; 36 } 37 38 public void visitSource(String source, String debug) { 39 } 40 41 public void visitOuterClass(String owner, String name, String desc) { 42 } 43 44 public AnnotationVisitor visitAnnotation(String desc, boolean visible) { 45 return NullAnnotationVisitor.NULL_ANNOTATION_ADAPTER; 46 } 47 48 public void visitAttribute(Attribute attribute) { 49 } 50 51 public void visitEnd() { 52 } 53 } 54 55 60 public static class NullMethodAdapter implements MethodVisitor { 61 62 public final static MethodVisitor NULL_METHOD_ADAPTER = new NullMethodAdapter(); 63 64 public void visitInsn(int opcode) { 65 } 66 67 public void visitIntInsn(int opcode, int operand) { 68 } 69 70 public void visitVarInsn(int opcode, int var) { 71 } 72 73 public void visitTypeInsn(int opcode, String desc) { 74 } 75 76 public void visitFieldInsn(int opcode, String owner, String name, String desc) { 77 } 78 79 public void visitMethodInsn(int opcode, String owner, String name, String desc) { 80 } 81 82 public void visitJumpInsn(int opcode, Label label) { 83 } 84 85 public void visitLabel(Label label) { 86 } 87 88 public void visitLdcInsn(Object cst) { 89 } 90 91 public void visitIincInsn(int var, int increment) { 92 } 93 94 public void visitTableSwitchInsn(int min, int max, Label dflt, Label labels[]) { 95 } 96 97 public void visitLookupSwitchInsn(Label dflt, int keys[], Label labels[]) { 98 } 99 100 public void visitMultiANewArrayInsn(String desc, int dims) { 101 } 102 103 public void visitTryCatchBlock(Label start, Label end, Label handler, String type) { 104 } 105 106 public void visitMaxs(int maxStack, int maxLocals) { 107 } 108 109 public void visitLocalVariable(String name, String desc, String sig, Label start, Label end, int index) { 110 } 111 112 public void visitLineNumber(int line, Label start) { 113 } 114 115 public void visitAttribute(Attribute attr) { 116 } 117 118 public AnnotationVisitor visitAnnotationDefault() { 119 return NullAnnotationVisitor.NULL_ANNOTATION_ADAPTER; 120 } 121 122 public AnnotationVisitor visitAnnotation(String desc, boolean visible) { 123 return NullAnnotationVisitor.NULL_ANNOTATION_ADAPTER; 124 } 125 126 public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) { 127 return NullAnnotationVisitor.NULL_ANNOTATION_ADAPTER; 128 } 129 130 public void visitCode() { 131 } 132 133 public void visitEnd() { 134 } 135 } 136 137 140 public static class NullFieldAdapter implements FieldVisitor { 141 142 public final static FieldVisitor NULL_FIELD_ADAPTER = new NullFieldAdapter(); 143 144 public AnnotationVisitor visitAnnotation(String desc, boolean visible) { 145 return NullAnnotationVisitor.NULL_ANNOTATION_ADAPTER; 146 } 147 148 public void visitAttribute(Attribute attr) { 149 } 150 151 public void visitEnd() { 152 } 153 } 154 155 158 public static class NullAnnotationVisitor implements AnnotationVisitor { 159 160 public final static AnnotationVisitor NULL_ANNOTATION_ADAPTER = new NullAnnotationVisitor(); 161 162 public void visit(String name, Object value) { 163 } 164 165 public void visitEnum(String name, String desc, String value) { 166 } 167 168 public AnnotationVisitor visitAnnotation(String name, String desc) { 169 return NULL_ANNOTATION_ADAPTER; 170 } 171 172 public AnnotationVisitor visitArray(String name) { 173 return NULL_ANNOTATION_ADAPTER; 174 } 175 176 public void visitEnd() { 177 } 178 } 179 } 180 | Popular Tags |