edu.ucsb.ccs.jcontractor.transformation
Class LoadContractClassTransformation
java.lang.Object
|
+--edu.ucsb.ccs.jcontractor.transformation.Transformation
|
+--edu.ucsb.ccs.jcontractor.transformation.ContractTransformation
|
+--edu.ucsb.ccs.jcontractor.transformation.LoadContractClassTransformation
- public class LoadContractClassTransformation
- extends ContractTransformation
A transformation that loads the contract class for the transformed
class into the Repository so that it will be available to
subsequent transformations. The contract class has a "_CONTRACT"
suffix (as in "MyClass" and "MyClass_CONTRACT"), and defines
contracts for another class. Before inserting code to check the
contracts, the contract class needs to be accessible in the
Repository. This transformation should be run before
transformations requiring access to the contract class. The
transformation does not modify the current class or any of it's
methods.
- Version:
- $Id: LoadContractClassTransformation.java,v 1.4 2002/05/12 00:09:16 parkera Exp $
- Author:
- Parker Abercrombie
|
Method Summary |
boolean |
acceptClass()
Determine if the current class should be processed. |
void |
transformClass()
Load the contract class that goes with the current class into the
Repository. |
void |
transformMethod(org.apache.bcel.generic.MethodGen mg)
Does nothing. |
| Methods inherited from class edu.ucsb.ccs.jcontractor.transformation.ContractTransformation |
canCheckEntryInvariant, canCheckExitInvariant, canCheckPostcondition, canCheckPrecondition, canHaveInvariant, canHavePostcondition, canHavePrecondition, canReferenceOld, contractsCheckable, getContractClassName, getContractClassName, getInvariantMethodName, getInvariantMethodSignature, getPostconditionMethodName, getPostconditionMethodSignature, getPreconditionMethodName, getPreconditionMethodSignature, isContractClass, isContractMethod, isInvariantMethod, isPostconditionMethod, isPreconditionMethod |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LoadContractClassTransformation
public LoadContractClassTransformation()
acceptClass
public boolean acceptClass()
- Determine if the current class should be processed. All classes
except for contract classes are processed.
- Overrides:
acceptClass in class Transformation
- Returns:
- true if the current class is not a contract class.
transformClass
public void transformClass()
throws AbortTransformationException
- Load the contract class that goes with the current class into the
Repository.
- Overrides:
transformClass in class Transformation
- Throws:
AbortTransformationException - if the contract class
file has invalid format.
transformMethod
public void transformMethod(org.apache.bcel.generic.MethodGen mg)
- Does nothing. This transformation operates only on classes.
- Overrides:
transformMethod in class Transformation