1 16 package net.sf.cglib.transform; 17 18 import org.objectweb.asm.Attribute; 19 import org.objectweb.asm.CodeVisitor; 20 import org.objectweb.asm.ClassVisitor; 21 import org.objectweb.asm.Label; 22 23 public class NullClassVisitor implements ClassVisitor { 24 public static final NullClassVisitor INSTANCE = new NullClassVisitor(); 25 26 public void visit(int version, int access, String name, String superName, String [] interfaces, String sourceFile) { } 27 public void visitEnd() { } 28 public void visitField(int access, String name, String desc, Object value, Attribute attrs) { } 29 public void visitInnerClass(String name, String outerName, String innerName, int access) { } 30 public void visitAttribute(Attribute attrs) { } 31 32 public CodeVisitor visitMethod(int access, String name, String desc, String [] exceptions, Attribute attrs) { 33 return NullCodeVisitor.INSTANCE; 34 } 35 36 private static class NullCodeVisitor implements CodeVisitor { 37 public static final NullCodeVisitor INSTANCE = new NullCodeVisitor(); 38 39 public void visitFieldInsn(int opcode, String owner, String name, String desc) { } 40 public void visitIincInsn(int var, int increment) { } 41 public void visitInsn(int opcode) { } 42 public void visitIntInsn(int opcode, int operand) { } 43 public void visitJumpInsn(int opcode, Label label) { } 44 public void visitLabel(Label label) { } 45 public void visitLdcInsn(Object cst) { } 46 public void visitLineNumber(int line, Label start) { } 47 public void visitLocalVariable(String name, String desc, Label start, Label end, int index) { } 48 public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) { } 49 public void visitMaxs(int maxStack, int maxLocals) { } 50 public void visitMethodInsn(int opcode, String owner, String name, String desc) { } 51 public void visitMultiANewArrayInsn(String desc, int dims) { } 52 public void visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels) { } 53 public void visitTryCatchBlock(Label start, Label end, Label handler, String type) { } 54 public void visitTypeInsn(int opcode, String desc) { } 55 public void visitVarInsn(int opcode, int var) { } 56 public void visitAttribute(Attribute attrs) { } 57 } 58 } 59 | Popular Tags |