rlm@10: /*** rlm@10: * ASM: a very small and fast Java bytecode manipulation framework rlm@10: * Copyright (c) 2000-2005 INRIA, France Telecom rlm@10: * All rights reserved. rlm@10: * rlm@10: * Redistribution and use in source and binary forms, with or without rlm@10: * modification, are permitted provided that the following conditions rlm@10: * are met: rlm@10: * 1. Redistributions of source code must retain the above copyright rlm@10: * notice, this list of conditions and the following disclaimer. rlm@10: * 2. Redistributions in binary form must reproduce the above copyright rlm@10: * notice, this list of conditions and the following disclaimer in the rlm@10: * documentation and/or other materials provided with the distribution. rlm@10: * 3. Neither the name of the copyright holders nor the names of its rlm@10: * contributors may be used to endorse or promote products derived from rlm@10: * this software without specific prior written permission. rlm@10: * rlm@10: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" rlm@10: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE rlm@10: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE rlm@10: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE rlm@10: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR rlm@10: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF rlm@10: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS rlm@10: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN rlm@10: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) rlm@10: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF rlm@10: * THE POSSIBILITY OF SUCH DAMAGE. rlm@10: */ rlm@10: package clojure.asm; rlm@10: rlm@10: /** rlm@10: * An empty {@link ClassVisitor} that delegates to another {@link ClassVisitor}. rlm@10: * This class can be used as a super class to quickly implement usefull class rlm@10: * adapter classes, just by overriding the necessary methods. rlm@10: * rlm@10: * @author Eric Bruneton rlm@10: */ rlm@10: public class ClassAdapter implements ClassVisitor{ rlm@10: rlm@10: /** rlm@10: * The {@link ClassVisitor} to which this adapter delegates calls. rlm@10: */ rlm@10: protected ClassVisitor cv; rlm@10: rlm@10: /** rlm@10: * Constructs a new {@link ClassAdapter} object. rlm@10: * rlm@10: * @param cv the class visitor to which this adapter must delegate calls. rlm@10: */ rlm@10: public ClassAdapter(final ClassVisitor cv){ rlm@10: this.cv = cv; rlm@10: } rlm@10: rlm@10: public void visit( rlm@10: final int version, rlm@10: final int access, rlm@10: final String name, rlm@10: final String signature, rlm@10: final String superName, rlm@10: final String[] interfaces){ rlm@10: cv.visit(version, access, name, signature, superName, interfaces); rlm@10: } rlm@10: rlm@10: public void visitSource(final String source, final String debug){ rlm@10: cv.visitSource(source, debug); rlm@10: } rlm@10: rlm@10: public void visitOuterClass( rlm@10: final String owner, rlm@10: final String name, rlm@10: final String desc){ rlm@10: cv.visitOuterClass(owner, name, desc); rlm@10: } rlm@10: rlm@10: public AnnotationVisitor visitAnnotation( rlm@10: final String desc, rlm@10: final boolean visible){ rlm@10: return cv.visitAnnotation(desc, visible); rlm@10: } rlm@10: rlm@10: public void visitAttribute(final Attribute attr){ rlm@10: cv.visitAttribute(attr); rlm@10: } rlm@10: rlm@10: public void visitInnerClass( rlm@10: final String name, rlm@10: final String outerName, rlm@10: final String innerName, rlm@10: final int access){ rlm@10: cv.visitInnerClass(name, outerName, innerName, access); rlm@10: } rlm@10: rlm@10: public FieldVisitor visitField( rlm@10: final int access, rlm@10: final String name, rlm@10: final String desc, rlm@10: final String signature, rlm@10: final Object value){ rlm@10: return cv.visitField(access, name, desc, signature, value); rlm@10: } rlm@10: rlm@10: public MethodVisitor visitMethod( rlm@10: final int access, rlm@10: final String name, rlm@10: final String desc, rlm@10: final String signature, rlm@10: final String[] exceptions){ rlm@10: return cv.visitMethod(access, name, desc, signature, exceptions); rlm@10: } rlm@10: rlm@10: public void visitEnd(){ rlm@10: cv.visitEnd(); rlm@10: } rlm@10: }