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.signature.SignatureVisitor;
034:
035: /**
036: * @author Taras Puchko
037: */
038: abstract class SignatureAdapter implements SignatureVisitor {
039:
040: final private SignatureVisitor visitor;
041:
042: public SignatureAdapter(final SignatureVisitor visitor) {
043: this .visitor = visitor;
044: }
045:
046: protected SignatureVisitor visitStart(SignatureVisitor visitor) {
047: return visitor;
048: }
049:
050: public void visitFormalTypeParameter(String name) {
051: visitor.visitFormalTypeParameter(name);
052: }
053:
054: public SignatureVisitor visitClassBound() {
055: return visitStart(this .visitor.visitClassBound());
056: }
057:
058: public SignatureVisitor visitInterfaceBound() {
059: return visitStart(visitor.visitInterfaceBound());
060: }
061:
062: public SignatureVisitor visitSuperclass() {
063: return visitStart(visitor.visitSuperclass());
064: }
065:
066: public SignatureVisitor visitInterface() {
067: return visitStart(visitor.visitInterface());
068: }
069:
070: public SignatureVisitor visitParameterType() {
071: return visitStart(visitor.visitParameterType());
072: }
073:
074: public SignatureVisitor visitReturnType() {
075: return visitStart(visitor.visitReturnType());
076: }
077:
078: public SignatureVisitor visitExceptionType() {
079: return visitStart(visitor.visitExceptionType());
080: }
081:
082: public void visitBaseType(char descriptor) {
083: visitor.visitBaseType(descriptor);
084: }
085:
086: public void visitTypeVariable(String name) {
087: visitor.visitTypeVariable(name);
088: }
089:
090: public SignatureVisitor visitArrayType() {
091: return visitStart(visitor.visitArrayType());
092: }
093:
094: public void visitClassType(String name) {
095: visitor.visitClassType(name);
096: }
097:
098: public void visitInnerClassType(String name) {
099: visitor.visitInnerClassType(name);
100: }
101:
102: public void visitTypeArgument() {
103: visitor.visitTypeArgument();
104: }
105:
106: public SignatureVisitor visitTypeArgument(char wildcard) {
107: return visitStart(visitor.visitTypeArgument(wildcard));
108: }
109:
110: public void visitEnd() {
111: visitor.visitEnd();
112: }
113: }
|