Class Instrumenter
java.lang.Object
org.matwoess.jsourceprofiler.tool.instrument.Instrumenter
This class is used to instrument the source files of a Java project.
It uses the Parser to parse the source files and find all code blocks.
It then inserts code to increment the counter for each code block.
Finally, it writes the instrumented source files to the instrumented directory.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstrumenter(JavaFile[] javaFiles, Arguments toolArgs) Creates a new Instrumenter with the given source files. -
Method Summary
Modifier and TypeMethodDescriptionvoidParses all source files and find all code blocks.static voidCopies the auxiliary files into the auxiliary directory.voidExports the metadata file.voidInstruments all source files.
-
Field Details
-
incRefAdd
-
-
Constructor Details
-
Instrumenter
Creates a new Instrumenter with the given source files.- Parameters:
javaFiles- the source files to instrumenttoolArgs- the tool command line arguments record
-
-
Method Details
-
analyzeFiles
public void analyzeFiles()Parses all source files and find all code blocks. -
instrumentFiles
public void instrumentFiles()Instruments all source files.The instrumented copy of each source file is then written to the instrumented directory.
-
exportMetadata
public void exportMetadata()Exports the metadata file. -
copyAuxiliaryFiles
public static void copyAuxiliaryFiles()Copies the auxiliary files into the auxiliary directory.Specifically, it copies the
__Counter.classfile to the auxiliary directory.
-