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 org.drools.asm;
030:
031: /**
032: * An empty {@link ClassVisitor} that delegates to another {@link ClassVisitor}.
033: * This class can be used as a super class to quickly implement usefull class
034: * adapter classes, just by overriding the necessary methods.
035: *
036: * @author Eric Bruneton
037: */
038: public class ClassAdapter implements ClassVisitor {
039:
040: /**
041: * The {@link ClassVisitor} to which this adapter delegates calls.
042: */
043: protected ClassVisitor cv;
044:
045: /**
046: * Constructs a new {@link ClassAdapter} object.
047: *
048: * @param cv the class visitor to which this adapter must delegate calls.
049: */
050: public ClassAdapter(final ClassVisitor cv) {
051: this .cv = cv;
052: }
053:
054: public void visit(final int version, final int access,
055: final String name, final String signature,
056: final String super Name, final String[] interfaces) {
057: this .cv.visit(version, access, name, signature, super Name,
058: interfaces);
059: }
060:
061: public void visitSource(final String source, final String debug) {
062: this .cv.visitSource(source, debug);
063: }
064:
065: public void visitOuterClass(final String owner, final String name,
066: final String desc) {
067: this .cv.visitOuterClass(owner, name, desc);
068: }
069:
070: public AnnotationVisitor visitAnnotation(final String desc,
071: final boolean visible) {
072: return this .cv.visitAnnotation(desc, visible);
073: }
074:
075: public void visitAttribute(final Attribute attr) {
076: this .cv.visitAttribute(attr);
077: }
078:
079: public void visitInnerClass(final String name,
080: final String outerName, final String innerName,
081: final int access) {
082: this .cv.visitInnerClass(name, outerName, innerName, access);
083: }
084:
085: public FieldVisitor visitField(final int access, final String name,
086: final String desc, final String signature,
087: final Object value) {
088: return this .cv.visitField(access, name, desc, signature, value);
089: }
090:
091: public MethodVisitor visitMethod(final int access,
092: final String name, final String desc,
093: final String signature, final String[] exceptions) {
094: return this .cv.visitMethod(access, name, desc, signature,
095: exceptions);
096: }
097:
098: public void visitEnd() {
099: this.cv.visitEnd();
100: }
101: }
|