Class MethodRecorder
java.lang.Object
org.objectweb.asm.ClassVisitor
org.checkerframework.afu.scenelib.util.MethodRecorder
public class MethodRecorder
extends org.objectweb.asm.ClassVisitor
A MethodRecorder is a
ClassVisitor which simply keeps track of the methods, fields and
declaration annotations inside a class. The main use of this class is to get this information in
the order it is visited by ClassWriter, which is the order in which they occur in the
classfile.-
Field Summary
Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv -
Constructor Summary
ConstructorsConstructorDescriptionMethodRecorder(int api) Construct a new MethodRecorder.MethodRecorder(int api, org.objectweb.asm.ClassVisitor classVisitor) Construct a new MethodRecorder. -
Method Summary
Modifier and TypeMethodDescriptionReturns the declaration annotations in the class in the order that they occur in the classfile.Returns the fields in the class in the order that they occur in the classfile.Returns the methods in the class in the order that they occur in the classfile.static void(Used for testing.)org.objectweb.asm.AnnotationVisitorvisitAnnotation(String descriptor, boolean visible) org.objectweb.asm.FieldVisitorvisitField(int access, String name, String descriptor, String signature, Object value) org.objectweb.asm.MethodVisitorvisitMethod(int access, String name, String descriptor, String signature, String[] exceptions) Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate, visit, visitAttribute, visitEnd, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
-
Constructor Details
-
MethodRecorder
public MethodRecorder(int api) Construct a new MethodRecorder.- Parameters:
api- version of ASM api to use
-
MethodRecorder
public MethodRecorder(int api, org.objectweb.asm.ClassVisitor classVisitor) Construct a new MethodRecorder.- Parameters:
api- version of ASM api to useclassVisitor- ClassVisitor to use
-
-
Method Details
-
visitMethod
public org.objectweb.asm.MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) - Overrides:
visitMethodin classorg.objectweb.asm.ClassVisitor
-
visitAnnotation
- Overrides:
visitAnnotationin classorg.objectweb.asm.ClassVisitor
-
getMethods
Returns the methods in the class in the order that they occur in the classfile.- Returns:
- list containing names of methods in the class
-
getAnnotations
Returns the declaration annotations in the class in the order that they occur in the classfile.- Returns:
- list containing names of declaration annotations in the class
-
getFields
Returns the fields in the class in the order that they occur in the classfile.- Returns:
- list containing names of fields in the class
-
visitField
public org.objectweb.asm.FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) - Overrides:
visitFieldin classorg.objectweb.asm.ClassVisitor
-
main
(Used for testing.)- Parameters:
args- input arguments- Throws:
IOException- if a problem occurs during ClassReader construction
-