001: /***
002: * ASM: a very small and fast Java bytecode manipulation framework
003: * Copyright (c) 2000-2005 INRIA, France Telecom
004: * All rights reserved.
005: *
006: * Redistribution and use in source and binary forms, with or without
007: * modification, are permitted provided that the following conditions
008: * are met:
009: * 1. Redistributions of source code must retain the above copyright
010: * notice, this list of conditions and the following disclaimer.
011: * 2. Redistributions in binary form must reproduce the above copyright
012: * notice, this list of conditions and the following disclaimer in the
013: * documentation and/or other materials provided with the distribution.
014: * 3. Neither the name of the copyright holders nor the names of its
015: * contributors may be used to endorse or promote products derived from
016: * this software without specific prior written permission.
017: *
018: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
020: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
021: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
022: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
024: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
025: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
026: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
027: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
028: * THE POSSIBILITY OF SUCH DAMAGE.
029: */package com.uwyn.rife.asm;
030:
031: /**
032: * An empty {@link MethodVisitor} that delegates to another
033: * {@link MethodVisitor}. This class can be used as a super class to quickly
034: * implement usefull method adapter classes, just by overriding the necessary
035: * methods.
036: *
037: * @author Eric Bruneton
038: */
039: public class MethodAdapter implements MethodVisitor {
040:
041: /**
042: * The {@link MethodVisitor} to which this adapter delegates calls.
043: */
044: protected MethodVisitor mv;
045:
046: /**
047: * Constructs a new {@link MethodAdapter} object.
048: *
049: * @param mv the code visitor to which this adapter must delegate calls.
050: */
051: public MethodAdapter(final MethodVisitor mv) {
052: this .mv = mv;
053: }
054:
055: public AnnotationVisitor visitAnnotationDefault() {
056: return mv.visitAnnotationDefault();
057: }
058:
059: public AnnotationVisitor visitAnnotation(final String desc,
060: final boolean visible) {
061: return mv.visitAnnotation(desc, visible);
062: }
063:
064: public AnnotationVisitor visitParameterAnnotation(
065: final int parameter, final String desc,
066: final boolean visible) {
067: return mv.visitParameterAnnotation(parameter, desc, visible);
068: }
069:
070: public void visitAttribute(final Attribute attr) {
071: mv.visitAttribute(attr);
072: }
073:
074: public void visitCode() {
075: mv.visitCode();
076: }
077:
078: public void visitInsn(final int opcode) {
079: mv.visitInsn(opcode);
080: }
081:
082: public void visitIntInsn(final int opcode, final int operand) {
083: mv.visitIntInsn(opcode, operand);
084: }
085:
086: public void visitVarInsn(final int opcode, final int var) {
087: mv.visitVarInsn(opcode, var);
088: }
089:
090: public void visitTypeInsn(final int opcode, final String desc) {
091: mv.visitTypeInsn(opcode, desc);
092: }
093:
094: public void visitFieldInsn(final int opcode, final String owner,
095: final String name, final String desc) {
096: mv.visitFieldInsn(opcode, owner, name, desc);
097: }
098:
099: public void visitMethodInsn(final int opcode, final String owner,
100: final String name, final String desc) {
101: mv.visitMethodInsn(opcode, owner, name, desc);
102: }
103:
104: public void visitJumpInsn(final int opcode, final Label label) {
105: mv.visitJumpInsn(opcode, label);
106: }
107:
108: public void visitLabel(final Label label) {
109: mv.visitLabel(label);
110: }
111:
112: public void visitLdcInsn(final Object cst) {
113: mv.visitLdcInsn(cst);
114: }
115:
116: public void visitIincInsn(final int var, final int increment) {
117: mv.visitIincInsn(var, increment);
118: }
119:
120: public void visitTableSwitchInsn(final int min, final int max,
121: final Label dflt, final Label labels[]) {
122: mv.visitTableSwitchInsn(min, max, dflt, labels);
123: }
124:
125: public void visitLookupSwitchInsn(final Label dflt,
126: final int keys[], final Label labels[]) {
127: mv.visitLookupSwitchInsn(dflt, keys, labels);
128: }
129:
130: public void visitMultiANewArrayInsn(final String desc,
131: final int dims) {
132: mv.visitMultiANewArrayInsn(desc, dims);
133: }
134:
135: public void visitTryCatchBlock(final Label start, final Label end,
136: final Label handler, final String type) {
137: mv.visitTryCatchBlock(start, end, handler, type);
138: }
139:
140: public void visitLocalVariable(final String name,
141: final String desc, final String signature,
142: final Label start, final Label end, final int index) {
143: mv.visitLocalVariable(name, desc, signature, start, end, index);
144: }
145:
146: public void visitLineNumber(final int line, final Label start) {
147: mv.visitLineNumber(line, start);
148: }
149:
150: public void visitMaxs(final int maxStack, final int maxLocals) {
151: mv.visitMaxs(maxStack, maxLocals);
152: }
153:
154: public void visitEnd() {
155: mv.visitEnd();
156: }
157: }
|