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 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
transformer
protected ClassTransformer transformer
- The ClassTransformer that contains this transformation. This
object contains data about the class being transformed.
Transformation
public Transformation()
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)