01: package tide.bytecode.asm;
02:
03: import java.util.Arrays;
04: import org.objectweb.asm.*;
05:
06: /** A true empty adapter.
07: */
08: public class ClassVisitorAd implements ClassVisitor {
09: public ClassVisitorAd() {
10: }
11:
12: static final boolean debug = false;
13:
14: private String _name;
15:
16: public void visit(final int version, final int access,
17: final String name, final String signature,
18: final String super Name, final String[] interfaces) {
19: this ._name = name;
20: if (debug)
21: System.out.println("visit " + name + "(" + signature
22: + "), " + super Name + ", "
23: + Arrays.toString(interfaces));
24: }
25:
26: /** ex: Main.java, debug is null
27: */
28: public void visitSource(final String source, final String debugg) {
29: if (debug)
30: System.out.println("visit source src=" + source + " dbg="
31: + debugg);
32: }
33:
34: public void visitOuterClass(final String owner, final String name,
35: final String desc) {
36: if (debug)
37: System.out.println("visit outer class " + name + ", "
38: + owner + ", " + desc);
39: }
40:
41: public AnnotationVisitor visitAnnotation(final String desc,
42: final boolean visible) {
43: if (debug)
44: System.out.println("visit annotation dest=" + desc
45: + ", vis=" + visible);
46: return AnnotationVisitorAd.emptyVis;
47: }
48:
49: public void visitAttribute(final Attribute attr) {
50: if (debug)
51: System.out.println("visitAttribute " + attr);
52: }
53:
54: public void visitInnerClass(final String name,
55: final String outerName, final String innerName,
56: final int access) {
57: if (debug)
58: System.out.println("visitInnerClass " + name + ", "
59: + outerName + ", " + innerName);
60: }
61:
62: public FieldVisitor visitField(final int access, final String name,
63: final String desc, final String signature,
64: final Object value) {
65: if (debug)
66: System.out.println("visit field " + access + ", " + name
67: + ", " + desc + ", " + signature + ", " + value);
68: return null;
69: }
70:
71: public MethodVisitor visitMethod(final int access,
72: final String name, final String desc,
73: final String signature, final String[] exceptions) {
74: if (debug)
75: System.out.println("\n\n========== visit method " + access
76: + ", " + name + ", " + desc + ", " + signature
77: + ", " + Arrays.toString(exceptions));
78: return MethodVisitorAd.emptyAd;
79: }
80:
81: public void visitEnd() {
82:
83: if (debug)
84: System.out.println("END class " + _name);
85: }
86:
87: }
|