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 com.ibm.wala.shrike.shrikeBT.tools.OfflineInstrumenterBase
OfflineInstrumenterBase.ManifestBuilder
-
Field Summary
Fields inherited from class com.ibm.wala.shrike.shrikeBT.tools.OfflineInstrumenterBase
cha
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getClassName
(Object cl) protected Object
makeClassFromStream
(String inputName, BufferedInputStream s) Get the next class to be instrumented.void
Update the original class with some method changes.void
outputModifiedClass
(ClassInstrumenter out, ClassWriter code) Update the original class with some method changes.protected void
writeClassTo
(Object cl, Object mods, OutputStream s) Methods inherited from class com.ibm.wala.shrike.shrikeBT.tools.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:
makeClassFromStream
in classOfflineInstrumenterBase
- Throws:
IOException
-
getClassName
- Specified by:
getClassName
in classOfflineInstrumenterBase
-
writeClassTo
- Specified by:
writeClassTo
in 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:
IllegalStateException
IOException
-
outputModifiedClass
Update the original class with some method changes. This method calls out.emitClass() for you.- Throws:
IllegalArgumentException
IOException
-