001: /***
002: * Retrotranslator: a Java bytecode transformer that translates Java classes
003: * compiled with JDK 5.0 into classes that can be run on JVM 1.4.
004: *
005: * Copyright (c) 2005 - 2008 Taras Puchko
006: * All rights reserved.
007: *
008: * Redistribution and use in source and binary forms, with or without
009: * modification, are permitted provided that the following conditions
010: * are met:
011: * 1. Redistributions of source code must retain the above copyright
012: * notice, this list of conditions and the following disclaimer.
013: * 2. Redistributions in binary form must reproduce the above copyright
014: * notice, this list of conditions and the following disclaimer in the
015: * documentation and/or other materials provided with the distribution.
016: * 3. Neither the name of the copyright holders nor the names of its
017: * contributors may be used to endorse or promote products derived from
018: * this software without specific prior written permission.
019: *
020: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
021: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
022: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
023: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
024: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
025: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
026: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
027: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
028: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
029: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
030: * THE POSSIBILITY OF SUCH DAMAGE.
031: */package net.sf.retrotranslator.transformer;
032:
033: import net.sf.retrotranslator.runtime.asm.*;
034:
035: /**
036: * @author Taras Puchko
037: */
038: class ReflectionDataVisitor extends ClassWriter {
039:
040: public ReflectionDataVisitor() {
041: super (false, true);
042: }
043:
044: public MethodVisitor visitMethod(int access, String name,
045: String desc, String signature, String[] exceptions) {
046: return new CleanerMethodVisitor(super .visitMethod(access, name,
047: desc, signature, exceptions));
048: }
049:
050: private static class CleanerMethodVisitor extends MethodAdapter {
051:
052: public CleanerMethodVisitor(MethodVisitor visitor) {
053: super (visitor);
054: }
055:
056: public void visitCode() {
057: }
058:
059: public void visitInsn(int opcode) {
060: }
061:
062: public void visitIntInsn(int opcode, int operand) {
063: }
064:
065: public void visitVarInsn(int opcode, int var) {
066: }
067:
068: public void visitTypeInsn(int opcode, String desc) {
069: }
070:
071: public void visitFieldInsn(int opcode, String owner,
072: String name, String desc) {
073: }
074:
075: public void visitMethodInsn(int opcode, String owner,
076: String name, String desc) {
077: }
078:
079: public void visitJumpInsn(int opcode, Label label) {
080: }
081:
082: public void visitLabel(Label label) {
083: }
084:
085: public void visitLdcInsn(Object cst) {
086: }
087:
088: public void visitIincInsn(int var, int increment) {
089: }
090:
091: public void visitTableSwitchInsn(int min, int max, Label dflt,
092: Label labels[]) {
093: }
094:
095: public void visitLookupSwitchInsn(Label dflt, int keys[],
096: Label labels[]) {
097: }
098:
099: public void visitMultiANewArrayInsn(String desc, int dims) {
100: }
101:
102: public void visitTryCatchBlock(Label start, Label end,
103: Label handler, String type) {
104: }
105:
106: public void visitLocalVariable(String name, String desc,
107: String signature, Label start, Label end, int index) {
108: }
109:
110: public void visitLineNumber(int line, Label start) {
111: }
112:
113: public void visitMaxs(int maxStack, int maxLocals) {
114: }
115: }
116:
117: }
|