1/* 2 * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26/* 27 * This file is available under and governed by the GNU General Public 28 * License version 2 only, as published by the Free Software Foundation. 29 * However, the following notice accompanied the original version of this 30 * file: 31 * 32 * ASM: a very small and fast Java bytecode manipulation framework 33 * Copyright (c) 2000-2007 INRIA, France Telecom 34 * All rights reserved. 35 * 36 * Redistribution and use in source and binary forms, with or without 37 * modification, are permitted provided that the following conditions 38 * are met: 39 * 1. Redistributions of source code must retain the above copyright 40 * notice, this list of conditions and the following disclaimer. 41 * 2. Redistributions in binary form must reproduce the above copyright 42 * notice, this list of conditions and the following disclaimer in the 43 * documentation and/or other materials provided with the distribution. 44 * 3. Neither the name of the copyright holders nor the names of its 45 * contributors may be used to endorse or promote products derived from 46 * this software without specific prior written permission. 47 * 48 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 49 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 51 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 52 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 53 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 54 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 55 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 56 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 57 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 58 * THE POSSIBILITY OF SUCH DAMAGE. 59 */ 60package com.sun.xml.internal.ws.org.objectweb.asm; 61 62/** 63 * An empty {@link MethodVisitor} that delegates to another 64 * {@link MethodVisitor}. This class can be used as a super class to quickly 65 * implement usefull method adapter classes, just by overriding the necessary 66 * methods. 67 * 68 * @author Eric Bruneton 69 */ 70public class MethodAdapter implements MethodVisitor { 71 72 /** 73 * The {@link MethodVisitor} to which this adapter delegates calls. 74 */ 75 protected MethodVisitor mv; 76 77 /** 78 * Constructs a new {@link MethodAdapter} object. 79 * 80 * @param mv the code visitor to which this adapter must delegate calls. 81 */ 82 public MethodAdapter(final MethodVisitor mv) { 83 this.mv = mv; 84 } 85 86 public AnnotationVisitor visitAnnotationDefault() { 87 return mv.visitAnnotationDefault(); 88 } 89 90 public AnnotationVisitor visitAnnotation( 91 final String desc, 92 final boolean visible) 93 { 94 return mv.visitAnnotation(desc, visible); 95 } 96 97 public AnnotationVisitor visitParameterAnnotation( 98 final int parameter, 99 final String desc, 100 final boolean visible) 101 { 102 return mv.visitParameterAnnotation(parameter, desc, visible); 103 } 104 105 public void visitAttribute(final Attribute attr) { 106 mv.visitAttribute(attr); 107 } 108 109 public void visitCode() { 110 mv.visitCode(); 111 } 112 113 public void visitFrame( 114 final int type, 115 final int nLocal, 116 final Object[] local, 117 final int nStack, 118 final Object[] stack) 119 { 120 mv.visitFrame(type, nLocal, local, nStack, stack); 121 } 122 123 public void visitInsn(final int opcode) { 124 mv.visitInsn(opcode); 125 } 126 127 public void visitIntInsn(final int opcode, final int operand) { 128 mv.visitIntInsn(opcode, operand); 129 } 130 131 public void visitVarInsn(final int opcode, final int var) { 132 mv.visitVarInsn(opcode, var); 133 } 134 135 public void visitTypeInsn(final int opcode, final String type) { 136 mv.visitTypeInsn(opcode, type); 137 } 138 139 public void visitFieldInsn( 140 final int opcode, 141 final String owner, 142 final String name, 143 final String desc) 144 { 145 mv.visitFieldInsn(opcode, owner, name, desc); 146 } 147 148 public void visitMethodInsn( 149 final int opcode, 150 final String owner, 151 final String name, 152 final String desc) 153 { 154 mv.visitMethodInsn(opcode, owner, name, desc); 155 } 156 157 public void visitJumpInsn(final int opcode, final Label label) { 158 mv.visitJumpInsn(opcode, label); 159 } 160 161 public void visitLabel(final Label label) { 162 mv.visitLabel(label); 163 } 164 165 public void visitLdcInsn(final Object cst) { 166 mv.visitLdcInsn(cst); 167 } 168 169 public void visitIincInsn(final int var, final int increment) { 170 mv.visitIincInsn(var, increment); 171 } 172 173 public void visitTableSwitchInsn( 174 final int min, 175 final int max, 176 final Label dflt, 177 final Label[] labels) 178 { 179 mv.visitTableSwitchInsn(min, max, dflt, labels); 180 } 181 182 public void visitLookupSwitchInsn( 183 final Label dflt, 184 final int[] keys, 185 final Label[] labels) 186 { 187 mv.visitLookupSwitchInsn(dflt, keys, labels); 188 } 189 190 public void visitMultiANewArrayInsn(final String desc, final int dims) { 191 mv.visitMultiANewArrayInsn(desc, dims); 192 } 193 194 public void visitTryCatchBlock( 195 final Label start, 196 final Label end, 197 final Label handler, 198 final String type) 199 { 200 mv.visitTryCatchBlock(start, end, handler, type); 201 } 202 203 public void visitLocalVariable( 204 final String name, 205 final String desc, 206 final String signature, 207 final Label start, 208 final Label end, 209 final int index) 210 { 211 mv.visitLocalVariable(name, desc, signature, start, end, index); 212 } 213 214 public void visitLineNumber(final int line, final Label start) { 215 mv.visitLineNumber(line, start); 216 } 217 218 public void visitMaxs(final int maxStack, final int maxLocals) { 219 mv.visitMaxs(maxStack, maxLocals); 220 } 221 222 public void visitEnd() { 223 mv.visitEnd(); 224 } 225} 226