Package com.ibm.wala.shrikeBT.shrikeCT
Class OfflineInstrumenter
- java.lang.Object
-
- com.ibm.wala.shrikeBT.tools.OfflineInstrumenterBase
-
- com.ibm.wala.shrikeBT.shrikeCT.OfflineInstrumenter
-
public final class OfflineInstrumenter extends OfflineInstrumenterBase
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.shrikeBT.tools.OfflineInstrumenterBase
OfflineInstrumenterBase.ManifestBuilder
-
-
Field Summary
-
Fields inherited from class com.ibm.wala.shrikeBT.tools.OfflineInstrumenterBase
cha
-
-
Constructor Summary
Constructors Constructor Description OfflineInstrumenter(boolean reuseStackMaps)
Create an empty collection of classes to instrument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getClassName(Object cl)
protected Object
makeClassFromStream(String inputName, BufferedInputStream s)
ClassInstrumenter
nextClass()
Get the next class to be instrumented.void
outputModifiedClass(ClassInstrumenter out)
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.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
-
-
-
-
Method Detail
-
makeClassFromStream
protected Object makeClassFromStream(String inputName, BufferedInputStream s) throws IOException
- Specified by:
makeClassFromStream
in classOfflineInstrumenterBase
- Throws:
IOException
-
getClassName
protected String getClassName(Object cl)
- Specified by:
getClassName
in classOfflineInstrumenterBase
-
writeClassTo
protected void writeClassTo(Object cl, Object mods, OutputStream s) throws IOException
- Specified by:
writeClassTo
in classOfflineInstrumenterBase
- Throws:
IOException
-
nextClass
public ClassInstrumenter nextClass() throws IOException
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
public void outputModifiedClass(ClassInstrumenter out) throws IllegalArgumentException, IOException
Update the original class with some method changes. This method calls out.emitClass() for you.- Throws:
IllegalArgumentException
IOException
-
-