1 /*** 2 * ASM: a very small and fast Java bytecode manipulation framework 3 * Copyright (c) 2000-2005 INRIA, France Telecom 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. Neither the name of the copyright holders nor the names of its 15 * contributors may be used to endorse or promote products derived from 16 * this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 package org.objectweb.asm.commons; 31 32 import org.objectweb.asm.AnnotationVisitor; 33 import org.objectweb.asm.Attribute; 34 import org.objectweb.asm.ClassVisitor; 35 import org.objectweb.asm.FieldVisitor; 36 import org.objectweb.asm.Label; 37 import org.objectweb.asm.MethodVisitor; 38 39 /** 40 * An empty implementation of the ASM visitor interfaces. 41 * 42 * @author Eric Bruneton 43 */ 44 public class EmptyVisitor implements 45 ClassVisitor, 46 FieldVisitor, 47 MethodVisitor, 48 AnnotationVisitor 49 { 50 visit( int version, int access, String name, String signature, String superName, String[] interfaces)51 public void visit( 52 int version, 53 int access, 54 String name, 55 String signature, 56 String superName, 57 String[] interfaces) 58 { 59 } 60 visitSource(String source, String debug)61 public void visitSource(String source, String debug) { 62 } 63 visitOuterClass(String owner, String name, String desc)64 public void visitOuterClass(String owner, String name, String desc) { 65 } 66 visitAnnotation(String desc, boolean visible)67 public AnnotationVisitor visitAnnotation(String desc, boolean visible) { 68 return this; 69 } 70 visitAttribute(Attribute attr)71 public void visitAttribute(Attribute attr) { 72 } 73 visitInnerClass( String name, String outerName, String innerName, int access)74 public void visitInnerClass( 75 String name, 76 String outerName, 77 String innerName, 78 int access) 79 { 80 } 81 visitField( int access, String name, String desc, String signature, Object value)82 public FieldVisitor visitField( 83 int access, 84 String name, 85 String desc, 86 String signature, 87 Object value) 88 { 89 return this; 90 } 91 visitMethod( int access, String name, String desc, String signature, String[] exceptions)92 public MethodVisitor visitMethod( 93 int access, 94 String name, 95 String desc, 96 String signature, 97 String[] exceptions) 98 { 99 return this; 100 } 101 visitEnd()102 public void visitEnd() { 103 } 104 visitAnnotationDefault()105 public AnnotationVisitor visitAnnotationDefault() { 106 return this; 107 } 108 visitParameterAnnotation( int parameter, String desc, boolean visible)109 public AnnotationVisitor visitParameterAnnotation( 110 int parameter, 111 String desc, 112 boolean visible) 113 { 114 return this; 115 } 116 visitCode()117 public void visitCode() { 118 } 119 visitInsn(int opcode)120 public void visitInsn(int opcode) { 121 } 122 visitIntInsn(int opcode, int operand)123 public void visitIntInsn(int opcode, int operand) { 124 } 125 visitVarInsn(int opcode, int var)126 public void visitVarInsn(int opcode, int var) { 127 } 128 visitTypeInsn(int opcode, String desc)129 public void visitTypeInsn(int opcode, String desc) { 130 } 131 visitFieldInsn( int opcode, String owner, String name, String desc)132 public void visitFieldInsn( 133 int opcode, 134 String owner, 135 String name, 136 String desc) 137 { 138 } 139 visitMethodInsn( int opcode, String owner, String name, String desc)140 public void visitMethodInsn( 141 int opcode, 142 String owner, 143 String name, 144 String desc) 145 { 146 } 147 visitJumpInsn(int opcode, Label label)148 public void visitJumpInsn(int opcode, Label label) { 149 } 150 visitLabel(Label label)151 public void visitLabel(Label label) { 152 } 153 visitLdcInsn(Object cst)154 public void visitLdcInsn(Object cst) { 155 } 156 visitIincInsn(int var, int increment)157 public void visitIincInsn(int var, int increment) { 158 } 159 visitTableSwitchInsn( int min, int max, Label dflt, Label labels[])160 public void visitTableSwitchInsn( 161 int min, 162 int max, 163 Label dflt, 164 Label labels[]) 165 { 166 } 167 visitLookupSwitchInsn(Label dflt, int keys[], Label labels[])168 public void visitLookupSwitchInsn(Label dflt, int keys[], Label labels[]) { 169 } 170 visitMultiANewArrayInsn(String desc, int dims)171 public void visitMultiANewArrayInsn(String desc, int dims) { 172 } 173 visitTryCatchBlock( Label start, Label end, Label handler, String type)174 public void visitTryCatchBlock( 175 Label start, 176 Label end, 177 Label handler, 178 String type) 179 { 180 } 181 visitLocalVariable( String name, String desc, String signature, Label start, Label end, int index)182 public void visitLocalVariable( 183 String name, 184 String desc, 185 String signature, 186 Label start, 187 Label end, 188 int index) 189 { 190 } 191 visitLineNumber(int line, Label start)192 public void visitLineNumber(int line, Label start) { 193 } 194 visitMaxs(int maxStack, int maxLocals)195 public void visitMaxs(int maxStack, int maxLocals) { 196 } 197 visit(String name, Object value)198 public void visit(String name, Object value) { 199 } 200 visitEnum(String name, String desc, String value)201 public void visitEnum(String name, String desc, String value) { 202 } 203 visitAnnotation(String name, String desc)204 public AnnotationVisitor visitAnnotation(String name, String desc) { 205 return this; 206 } 207 visitArray(String name)208 public AnnotationVisitor visitArray(String name) { 209 return this; 210 } 211 } 212