Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.ucsb.ccs.jcontractor.transformation
Class Transformation  view Transformation download Transformation.java

java.lang.Object
  extended byedu.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 $

Field Summary
protected  ClassTransformer transformer
          The ClassTransformer that contains this transformation.
 
Constructor Summary
Transformation()
           
 
Method Summary
protected  boolean acceptClass_Precondition()
           
protected abstract  boolean acceptClass()
          Determine if this transform should be applied to the current class.
protected  boolean getTransformer_Postcondition(ClassTransformer RESULT)
           
 ClassTransformer getTransformer()
          Get the transformer to which this transformation belongs.
protected  boolean setTransformer_Postcondition(ClassTransformer classTransformer, java.lang.Void RESULT)
           
protected  boolean setTransformer_Precondition(ClassTransformer classTransformer)
           
 void setTransformer(ClassTransformer classTransformer)
          Set the transformer to which the transformation belongs.
protected  boolean transform_Precondition()
           
 void transform()
          Apply the transformation to the current class (as determined by getTransformer().getCurrentClass()).
protected  boolean transformClass_Precondition()
           
protected abstract  void transformClass()
          Apply the transformation to current class object.
protected  boolean transformMethod_Precondition(org.apache.bcel.generic.MethodGen mg)
           
protected abstract  void transformMethod(org.apache.bcel.generic.MethodGen mg)
          Apply a transformation to a method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transformer

protected ClassTransformer transformer
The ClassTransformer that contains this transformation. This object contains data about the class being transformed.

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.


transform_Precondition

protected boolean transform_Precondition()

acceptClass

protected abstract boolean acceptClass()
Determine if this transform should be applied to the current class. If not, the transformClass() and transformMethod(MethodGen) will not be called for the class.


acceptClass_Precondition

protected boolean acceptClass_Precondition()

transformClass

protected abstract void transformClass()
                                throws AbortTransformationException
Apply the transformation to current class object. This method will only be called if acceptClass() evaluates true.


transformClass_Precondition

protected boolean transformClass_Precondition()

transformMethod

protected abstract void transformMethod(org.apache.bcel.generic.MethodGen mg)
                                 throws AbortTransformationException
Apply a transformation to a method. This method will only be called if acceptClass() evaluates true.


transformMethod_Precondition

protected boolean transformMethod_Precondition(org.apache.bcel.generic.MethodGen mg)

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.


setTransformer_Precondition

protected boolean setTransformer_Precondition(ClassTransformer classTransformer)

setTransformer_Postcondition

protected boolean setTransformer_Postcondition(ClassTransformer classTransformer,
                                               java.lang.Void RESULT)

getTransformer

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


getTransformer_Postcondition

protected boolean getTransformer_Postcondition(ClassTransformer RESULT)