com.ibm.wala.shrikeBT.shrikeCT
Class OfflineInstrumenter

java.lang.Object
  extended by com.ibm.wala.shrikeBT.tools.OfflineInstrumenterBase
      extended by 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
 
Constructor Summary
OfflineInstrumenter()
          Create an empty collection of classes to instrument.
 
Method Summary
protected  java.lang.String getClassName(java.lang.Object cl)
           
protected  java.lang.Object makeClassFromStream(java.io.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(java.lang.Object cl, java.lang.Object mods, java.io.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, readInputClasses, setIgnore, setJARComment, setManifestBuilder, setOutputJar, setPassUnmodifiedClasses, writeUnmodifiedClasses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OfflineInstrumenter

public OfflineInstrumenter()
Create an empty collection of classes to instrument.

Method Detail

makeClassFromStream

protected java.lang.Object makeClassFromStream(java.io.BufferedInputStream s)
                                        throws java.io.IOException
Specified by:
makeClassFromStream in class OfflineInstrumenterBase
Throws:
java.io.IOException

getClassName

protected java.lang.String getClassName(java.lang.Object cl)
Specified by:
getClassName in class OfflineInstrumenterBase

writeClassTo

protected void writeClassTo(java.lang.Object cl,
                            java.lang.Object mods,
                            java.io.OutputStream s)
                     throws java.io.IOException
Specified by:
writeClassTo in class OfflineInstrumenterBase
Throws:
java.io.IOException

nextClass

public ClassInstrumenter nextClass()
                            throws java.io.IOException
Get the next class to be instrumented.

Throws:
java.io.IOException

outputModifiedClass

public void outputModifiedClass(ClassInstrumenter out,
                                ClassWriter code)
                         throws java.lang.IllegalStateException,
                                java.io.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:
java.lang.IllegalStateException
java.io.IOException

outputModifiedClass

public void outputModifiedClass(ClassInstrumenter out)
                         throws java.lang.IllegalArgumentException,
                                java.io.IOException
Update the original class with some method changes. This method calls out.emitClass() for you.

Throws:
java.lang.IllegalArgumentException
java.io.IOException