edu.ucsb.ccs.jcontractor.transformation
Class Transformation

java.lang.Object
  |
  +--edu.ucsb.ccs.jcontractor.transformation.Transformation
Direct Known Subclasses:
ContractTransformation, InstrumentedFlagTransformation, MarkInstrumentedTransformation

public abstract class Transformation
extends java.lang.Object

Abstract description of a transformation that can be applied to a class. Each transformation is attached to a ClassTransformer, which holds data about the class being transformed, and provides a means for different transformations to share information.

Version:
$Id: Transformation.java,v 1.5 2002/05/12 00:09:17 parkera Exp $
Author:
Parker Abercrombie
See Also:
ClassTransformer

Constructor Summary
Transformation()
           
 
Method Summary
 ClassTransformer getTransformer()
          Get the transformer to which this transformation belongs.
 void setTransformer(ClassTransformer classTransformer)
          Set the transformer to which the transformation belongs.
 void transform()
          Apply the transformation to the current class (as determined by getTransformer().getCurrentClass()).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transformation

public Transformation()
Method Detail

transform

public void transform()
               throws AbortTransformationException
Apply the transformation to the current class (as determined by getTransformer().getCurrentClass()). If acceptClass() returns true, then transformClass() will be called, and transformMethod(MethodGen) will be called for each method in the class.

Throws:
AbortTransformationException - thrown if an error occurs that calls for a complete abort. This means that no subsequent transformations should be executed. Things are so terriby wrong that it is time to fail with an error message.

setTransformer

public void setTransformer(ClassTransformer classTransformer)
Set the transformer to which the transformation belongs. The transformer holds infomation about the current class, and provides a means for Transformations to share data.

Parameters:
classTransformer - the new transformer.

getTransformer

public ClassTransformer getTransformer()
Get the transformer to which this transformation belongs.

Returns:
the ClassTransformer to which the transformation belongs.