Class ClassAnnotationSceneReader

java.lang.Object
org.objectweb.asm.ClassVisitor
org.checkerframework.afu.scenelib.io.classfile.CodeOffsetAdapter
org.checkerframework.afu.scenelib.io.classfile.ClassAnnotationSceneReader

public class ClassAnnotationSceneReader extends CodeOffsetAdapter
A ClassAnnotationSceneReader is a ClassVisitor that will insert all annotations it encounters while visiting a class into a given AScene.

The "read" in ClassAnnotationSceneReader refers to a class file being read into a scene. Also see ClassAnnotationSceneWriter.

The proper usage of this class is to construct a ClassAnnotationSceneReader with an AScene into which annotations should be inserted, then pass this as a ClassVisitor to ClassReader.accept(org.objectweb.asm.ClassVisitor, int)

All other methods are intended to be called only by ClassReader.accept(org.objectweb.asm.ClassVisitor, int), and should not be called anywhere else, due to the order in which ClassVisitor methods should be called.

  • Field Summary

    Fields inherited from class org.objectweb.asm.ClassVisitor

    api, cv
  • Constructor Summary

    Constructors
    Constructor
    Description
    ClassAnnotationSceneReader(int api, org.objectweb.asm.ClassReader classReader, AScene scene, boolean ignoreBridgeMethods)
    Constructs a new ClassAnnotationSceneReader that will insert all the annotations in the class that it visits into scene.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    visit(int version, int access, String name, String signature, String superName, String[] interfaces)
     
    org.objectweb.asm.AnnotationVisitor
    visitAnnotation(String descriptor, boolean visible)
     
    org.objectweb.asm.FieldVisitor
    visitField(int access, String name, String descriptor, String signature, Object value)
     
    org.objectweb.asm.MethodVisitor
    visitMethod(int access, String name, String descriptor, String signature, String[] exceptions)
     
    org.objectweb.asm.AnnotationVisitor
    visitTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
     

    Methods inherited from class org.checkerframework.afu.scenelib.io.classfile.CodeOffsetAdapter

    getBytecodeOffset, getMethodCodeOffset, getPreviousCodeOffset

    Methods inherited from class org.objectweb.asm.ClassVisitor

    getDelegate, visitAttribute, visitEnd, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClassAnnotationSceneReader

      public ClassAnnotationSceneReader(int api, org.objectweb.asm.ClassReader classReader, AScene scene, boolean ignoreBridgeMethods)
      Constructs a new ClassAnnotationSceneReader that will insert all the annotations in the class that it visits into scene.
      Parameters:
      api - the ASM API version to use
      classReader - the ClassReader that visits this ClassAnnotationSceneReader
      scene - the annotation scene into which annotations this visits will be inserted
      ignoreBridgeMethods - if true, omit annotations on compiler-generated methods
  • Method Details

    • visit

      public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
      Overrides:
      visit in class org.objectweb.asm.ClassVisitor
    • visitAnnotation

      public org.objectweb.asm.AnnotationVisitor visitAnnotation(String descriptor, boolean visible)
      Overrides:
      visitAnnotation in class org.objectweb.asm.ClassVisitor
    • visitTypeAnnotation

      public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
      Overrides:
      visitTypeAnnotation in class org.objectweb.asm.ClassVisitor
    • visitField

      public org.objectweb.asm.FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value)
      Overrides:
      visitField in class org.objectweb.asm.ClassVisitor
    • visitMethod

      public org.objectweb.asm.MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions)
      Overrides:
      visitMethod in class CodeOffsetAdapter