Class ClassAnnotationSceneReader
java.lang.Object
org.objectweb.asm.ClassVisitor
org.checkerframework.afu.scenelib.io.classfile.CodeOffsetAdapter
org.checkerframework.afu.scenelib.io.classfile.ClassAnnotationSceneReader
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
ConstructorsConstructorDescriptionClassAnnotationSceneReader
(int api, org.objectweb.asm.ClassReader classReader, AScene scene, boolean ignoreBridgeMethods) Constructs a newClassAnnotationSceneReader
that will insert all the annotations in the class that it visits intoscene
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
-
Constructor Details
-
ClassAnnotationSceneReader
public ClassAnnotationSceneReader(int api, org.objectweb.asm.ClassReader classReader, AScene scene, boolean ignoreBridgeMethods) Constructs a newClassAnnotationSceneReader
that will insert all the annotations in the class that it visits intoscene
.- Parameters:
api
- the ASM API version to useclassReader
- theClassReader
that visits thisClassAnnotationSceneReader
scene
- the annotation scene into which annotations this visits will be insertedignoreBridgeMethods
- 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 classorg.objectweb.asm.ClassVisitor
-
visitAnnotation
- Overrides:
visitAnnotation
in classorg.objectweb.asm.ClassVisitor
-
visitTypeAnnotation
public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) - Overrides:
visitTypeAnnotation
in classorg.objectweb.asm.ClassVisitor
-
visitField
public org.objectweb.asm.FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) - Overrides:
visitField
in classorg.objectweb.asm.ClassVisitor
-
visitMethod
public org.objectweb.asm.MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) - Overrides:
visitMethod
in classCodeOffsetAdapter
-