org.osjava.jardiff
Class ClassInfoVisitor

java.lang.Object
  extended by org.objectweb.asm.commons.EmptyVisitor
      extended by org.osjava.jardiff.ClassInfoVisitor
All Implemented Interfaces:
org.objectweb.asm.AnnotationVisitor, org.objectweb.asm.ClassVisitor, org.objectweb.asm.FieldVisitor, org.objectweb.asm.MethodVisitor

public class ClassInfoVisitor
extends org.objectweb.asm.commons.EmptyVisitor

A reusable class which uses the ASM to build up ClassInfo about a java class file.

Author:
Antony Riley

Field Summary
private  int access
          The access flags for the class.
private  java.util.Map fieldMap
          A map of field signature to a FieldInfo describing the field.
private  java.lang.String[] interfaces
          An array of internal names of interfaces implemented by this class.
private  java.util.Map methodMap
          A map of method signature to a MethodInfo describing the method.
private  java.lang.String name
          The internal name of the class.
private  java.lang.String signature
          The signature of the class
private  java.lang.String supername
          The internal name of the superclass.
private  int version
          The class file version.
 
Constructor Summary
ClassInfoVisitor()
           
 
Method Summary
 ClassInfo getClassInfo()
          The the classInfo this ClassInfoVisitor has built up about a class
 void reset()
          Reset this ClassInfoVisitor so that it can be used to visit another class.
 void visit(int version, int access, java.lang.String name, java.lang.String signature, java.lang.String supername, java.lang.String[] interfaces)
          Receive notification of information about a class from ASM.
 org.objectweb.asm.FieldVisitor visitField(int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.Object value)
           
 org.objectweb.asm.MethodVisitor visitMethod(int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.String[] exceptions)
           
 
Methods inherited from class org.objectweb.asm.commons.EmptyVisitor
visit, visitAnnotation, visitAnnotation, visitAnnotationDefault, visitArray, visitAttribute, visitCode, visitEnd, visitEnum, visitFieldInsn, visitIincInsn, visitInnerClass, visitInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMultiANewArrayInsn, visitOuterClass, visitParameterAnnotation, visitSource, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn, visitVarInsn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

private int version
The class file version.


access

private int access
The access flags for the class.


name

private java.lang.String name
The internal name of the class.


signature

private java.lang.String signature
The signature of the class


supername

private java.lang.String supername
The internal name of the superclass.


interfaces

private java.lang.String[] interfaces
An array of internal names of interfaces implemented by this class.


methodMap

private java.util.Map methodMap
A map of method signature to a MethodInfo describing the method.


fieldMap

private java.util.Map fieldMap
A map of field signature to a FieldInfo describing the field.

Constructor Detail

ClassInfoVisitor

public ClassInfoVisitor()
Method Detail

reset

public void reset()
Reset this ClassInfoVisitor so that it can be used to visit another class.


getClassInfo

public ClassInfo getClassInfo()
The the classInfo this ClassInfoVisitor has built up about a class


visit

public void visit(int version,
                  int access,
                  java.lang.String name,
                  java.lang.String signature,
                  java.lang.String supername,
                  java.lang.String[] interfaces)
Receive notification of information about a class from ASM.

Specified by:
visit in interface org.objectweb.asm.ClassVisitor
Overrides:
visit in class org.objectweb.asm.commons.EmptyVisitor
Parameters:
version - the class file version number.
access - the access flags for the class.
name - the internal name of the class.
signature - the signature of the class.
supername - the internal name of the super class.
interfaces - the internal names of interfaces implemented.

visitMethod

public org.objectweb.asm.MethodVisitor visitMethod(int access,
                                                   java.lang.String name,
                                                   java.lang.String desc,
                                                   java.lang.String signature,
                                                   java.lang.String[] exceptions)
Specified by:
visitMethod in interface org.objectweb.asm.ClassVisitor
Overrides:
visitMethod in class org.objectweb.asm.commons.EmptyVisitor

visitField

public org.objectweb.asm.FieldVisitor visitField(int access,
                                                 java.lang.String name,
                                                 java.lang.String desc,
                                                 java.lang.String signature,
                                                 java.lang.Object value)
Specified by:
visitField in interface org.objectweb.asm.ClassVisitor
Overrides:
visitField in class org.objectweb.asm.commons.EmptyVisitor