Class ClassFileReader
java.lang.Object
org.checkerframework.afu.scenelib.io.classfile.ClassFileReader
A
ClassFileReader provides methods for reading in annotations from a class file into an
AScene.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic booleanstatic final Stringstatic booleanstatic boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckClass(String arg) If s is not a valid representation of a class, print a warning message and return false.static voidFrom the command line, read annotations from a class file and write them to an index file.static voidread(AScene scene, InputStream input) Reads the annotations from the class file indicated by the InputStream and inserts them intoscene.static voidReads the annotations from the class filefileNameand inserts them intoscene.static voidReads the annotations from the class file indicated by the ClassReader and inserts them intoscene.static voidreadFromClass(AScene scene, String className) Reads the annotations from the classclassName, assumed to be in your classpath, and inserts them intoscene.
-
Field Details
-
INDEX_UTILS_VERSION
- See Also:
-
ignore_bridge_methods
public static boolean ignore_bridge_methods -
help
public static boolean help -
version
public static boolean version -
verbose
public static boolean verbose
-
-
Constructor Details
-
ClassFileReader
public ClassFileReader()
-
-
Method Details
-
main
From the command line, read annotations from a class file and write them to an index file. Also see the Anncat tool, which is more versatile (and which calls this as a subroutine).For usage information, supply the
-hor--helpoption.For programmatic access to this tool, use the read() methods instead.
- Parameters:
args- options and classes to analyze;- Throws:
IOException- if a class file cannot be found
-
checkClass
If s is not a valid representation of a class, print a warning message and return false. -
read
Reads the annotations from the class filefileNameand inserts them intoscene.fileNameshould be a file name that can be resolved from the current working directory, which means it should end in ".class" for standard Java class files.- Parameters:
scene- the scene into which the annotations should be insertedfileName- the file name of the class the annotations should be read from- Throws:
IOException- if there is a problem reading fromfileName
-
readFromClass
Reads the annotations from the classclassName, assumed to be in your classpath, and inserts them intoscene.- Parameters:
scene- the scene into which the annotations should be insertedclassName- the name of the class to read in- Throws:
IOException- if there is a problem readingclassName
-
read
Reads the annotations from the class file indicated by the InputStream and inserts them intoscene.- Parameters:
scene- the scene into which the annotations should be insertedinput- an input stream containing the class that the annotations should be read from- Throws:
IOException- if there is a problem reading fromin
-
read
Reads the annotations from the class file indicated by the ClassReader and inserts them intoscene.- Parameters:
scene- the scene into which the annotations should be insertedclassReader- the ClassReader for the class thet the annotations should be read from
-