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.tc.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 visitFrame(final int type, final int nLocal,
079: final Object[] local, final int nStack, final Object[] stack) {
080: mv.visitFrame(type, nLocal, local, nStack, stack);
081: }
082:
083: public void visitInsn(final int opcode) {
084: mv.visitInsn(opcode);
085: }
086:
087: public void visitIntInsn(final int opcode, final int operand) {
088: mv.visitIntInsn(opcode, operand);
089: }
090:
091: public void visitVarInsn(final int opcode, final int var) {
092: mv.visitVarInsn(opcode, var);
093: }
094:
095: public void visitTypeInsn(final int opcode, final String desc) {
096: mv.visitTypeInsn(opcode, desc);
097: }
098:
099: public void visitFieldInsn(final int opcode, final String owner,
100: final String name, final String desc) {
101: mv.visitFieldInsn(opcode, owner, name, desc);
102: }
103:
104: public void visitMethodInsn(final int opcode, final String owner,
105: final String name, final String desc) {
106: mv.visitMethodInsn(opcode, owner, name, desc);
107: }
108:
109: public void visitJumpInsn(final int opcode, final Label label) {
110: mv.visitJumpInsn(opcode, label);
111: }
112:
113: public void visitLabel(final Label label) {
114: mv.visitLabel(label);
115: }
116:
117: public void visitLdcInsn(final Object cst) {
118: mv.visitLdcInsn(cst);
119: }
120:
121: public void visitIincInsn(final int var, final int increment) {
122: mv.visitIincInsn(var, increment);
123: }
124:
125: public void visitTableSwitchInsn(final int min, final int max,
126: final Label dflt, final Label labels[]) {
127: mv.visitTableSwitchInsn(min, max, dflt, labels);
128: }
129:
130: public void visitLookupSwitchInsn(final Label dflt,
131: final int keys[], final Label labels[]) {
132: mv.visitLookupSwitchInsn(dflt, keys, labels);
133: }
134:
135: public void visitMultiANewArrayInsn(final String desc,
136: final int dims) {
137: mv.visitMultiANewArrayInsn(desc, dims);
138: }
139:
140: public void visitTryCatchBlock(final Label start, final Label end,
141: final Label handler, final String type) {
142: mv.visitTryCatchBlock(start, end, handler, type);
143: }
144:
145: public void visitLocalVariable(final String name,
146: final String desc, final String signature,
147: final Label start, final Label end, final int index) {
148: mv.visitLocalVariable(name, desc, signature, start, end, index);
149: }
150:
151: public void visitLineNumber(final int line, final Label start) {
152: mv.visitLineNumber(line, start);
153: }
154:
155: public void visitMaxs(final int maxStack, final int maxLocals) {
156: mv.visitMaxs(maxStack, maxLocals);
157: }
158:
159: public void visitEnd() {
160: mv.visitEnd();
161: }
162: }
|