Class OfflineInstrumenter
java.lang.Object
com.ibm.wala.shrike.shrikeBT.tools.OfflineInstrumenterBase
com.ibm.wala.shrike.shrikeBT.shrikeCT.OfflineInstrumenter
This class provides a convenient way to iterate through a collection of Java classes and
instrument their code. This is just a specialization of OfflineInstrumenterBase to use the
shrikeCT functionality.
-
Nested Class Summary
Nested classes/interfaces inherited from class OfflineInstrumenterBase
OfflineInstrumenterBase.ManifestBuilder -
Field Summary
Fields inherited from class OfflineInstrumenterBase
cha -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetClassName(Object cl) protected ObjectmakeClassFromStream(String inputName, BufferedInputStream s) Get the next class to be instrumented.voidUpdate the original class with some method changes.voidoutputModifiedClass(ClassInstrumenter out, ClassWriter code) Update the original class with some method changes.protected voidwriteClassTo(Object cl, Object mods, OutputStream s) Methods inherited from class OfflineInstrumenterBase
addInputClass, addInputDirectory, addInputElement, addInputJar, addInputJarEntry, addOutputJarEntry, beginTraversal, close, copyStream, endOutputJarEntry, getLastClassResourceName, getNumInputClasses, getOutputFile, internalNextClass, internalOutputModifiedClass, parseStandardArgs, setClassHierarchyProvider, setIgnore, setJARComment, setManifestBuilder, setOutputJar, setPassUnmodifiedClasses, writeUnmodifiedClasses
-
Constructor Details
-
OfflineInstrumenter
public OfflineInstrumenter()
-
-
Method Details
-
makeClassFromStream
- Specified by:
makeClassFromStreamin classOfflineInstrumenterBase- Throws:
IOException
-
getClassName
- Specified by:
getClassNamein classOfflineInstrumenterBase
-
writeClassTo
- Specified by:
writeClassToin classOfflineInstrumenterBase- Throws:
IOException
-
nextClass
Get the next class to be instrumented.- Throws:
IOException
-
outputModifiedClass
public void outputModifiedClass(ClassInstrumenter out, ClassWriter code) throws IllegalStateException, IOException Update the original class with some method changes. 'code' should be the result of out.emitClass(). You can add new fields and methods to 'code' (or make other changes) before calling this method.- Throws:
IllegalStateExceptionIOException
-
outputModifiedClass
Update the original class with some method changes. This method calls out.emitClass() for you.- Throws:
IllegalArgumentExceptionIOException
-