Class ClassInfoVisitor


  • public class ClassInfoVisitor
    extends org.objectweb.asm.ClassVisitor
    A reusable class which uses the ASM to build up ClassInfo about a java class file.
    Author:
    Antony Riley
    • Field Summary

      Fields 
      Modifier and Type Field Description
      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.
      • Fields inherited from class org.objectweb.asm.ClassVisitor

        api, cv
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.ClassVisitor

        visitAnnotation, visitAttribute, visitEnd, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubtypeExperimental, visitRecordComponent, visitSource, visitTypeAnnotation
      • 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.
        Overrides:
        visit in class org.objectweb.asm.ClassVisitor
        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)
        Overrides:
        visitMethod in class org.objectweb.asm.ClassVisitor
      • 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)
        Overrides:
        visitField in class org.objectweb.asm.ClassVisitor