ClassVisitorAd.java :  » IDE » tIDE » tide » bytecode » asm » Java Open Source

Java Open Source » IDE » tIDE 
tIDE » tide » bytecode » asm » ClassVisitorAd.java
package tide.bytecode.asm;

import java.util.Arrays;
import org.objectweb.asm.*;

/** A true empty adapter.
*/
public class ClassVisitorAd implements ClassVisitor
{
   public ClassVisitorAd()
   {
   }

   static final boolean debug = false;

   private String _name;

   public void visit(
        final int version,
        final int access,
        final String name,
        final String signature,
        final String superName,
        final String[] interfaces)
    {
       this._name = name;
       if(debug) System.out.println("visit "+name+"("+signature+"), "+superName+", "+Arrays.toString(interfaces));
    }

    /** ex: Main.java, debug is null
    */
    public void visitSource(final String source, final String debugg)
    {
       if(debug) System.out.println("visit source src="+source+" dbg="+debugg);
    }

    public void visitOuterClass(
        final String owner,
        final String name,
        final String desc)
    {
        if(debug) System.out.println("visit outer class "+name+", "+owner+", "+desc);
    }

    public AnnotationVisitor visitAnnotation(
        final String desc,
        final boolean visible)
    {
        if(debug) System.out.println("visit annotation dest="+desc+", vis="+visible);
        return AnnotationVisitorAd.emptyVis;
    }

    public void visitAttribute(final Attribute attr)
    {
        if(debug) System.out.println("visitAttribute "+attr);
    }

    public void visitInnerClass(
        final String name,
        final String outerName,
        final String innerName,
        final int access)
    {
        if(debug) System.out.println("visitInnerClass "+name+", "+outerName+", "+innerName);
    }

    public FieldVisitor visitField(
        final int access,
        final String name,
        final String desc,
        final String signature,
        final Object value)
    {
        if(debug) System.out.println("visit field "+access+", "+name+", "+desc+", "+signature+", "+value);
        return null;
    }

    public MethodVisitor visitMethod(
        final int access,
        final String name,
        final String desc,
        final String signature,
        final String[] exceptions)
    {
        if(debug) System.out.println("\n\n========== visit method "+access+", "+name+", "+desc+", "+signature+", "+Arrays.toString(exceptions));
        return MethodVisitorAd.emptyAd;
    }

    public void visitEnd() {

        if(debug) System.out.println("END class "+_name);
    }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.