|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--edu.ucsb.ccs.jcontractor.transformation.ClassTransformer
A ClassTransformer executes a complex transformation on a JavaClass object. The complex transform is made up of simpler transforms that are carried out in sequence on the class itself and on each method.
Transformations are stored as a list, and are executed in the
order that they appear. The list may be modified with
insert(Transformation) and
append(Transformation). Use the
transform(JavaClass) method to apply the
transformations to a class.
Transformation| Constructor Summary | |
ClassTransformer(InstrumentationFilter filter)
Create an empty ClassTransformer. |
|
| Method Summary | |
void |
append(Transformation t)
Add a Transformation at the end of the transformation list. |
org.apache.bcel.generic.ConstantPoolGen |
getConstantPoolGen()
Get the ConstantPoolGen object that is to be used to build the constant pool for the current class. |
org.apache.bcel.classfile.JavaClass |
getCurrentClass()
Get the class that the transformer is transforming. |
org.apache.bcel.generic.InstructionFactory |
getInstructionFactory()
Get the instruction factory that should be used to create instructions. |
InstrumentationFilter |
getInstrumentationFilter()
Get the instrumentation filter that determines which classes are instrumented and to what level. |
MethodSet |
getMethodSet()
Get the method set that holds working copies of the methods in the current class. |
java.util.Hashtable |
getSharedInfo()
Get the shared data table. |
void |
insert(Transformation t)
Insert a transformation at the beginning of the list. |
void |
setInstructionFactory(org.apache.bcel.generic.InstructionFactory factory)
Set the instruction factory to be used to create bytecode for the current class. |
void |
setInstrumentationFilter(InstrumentationFilter filter)
Set the instrumentation filter that determines which classes are instrumented and to what level. |
int |
size()
Get the number of transformations in the transformer. |
void |
transform(org.apache.bcel.classfile.JavaClass javaclass)
Transform a class. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ClassTransformer(InstrumentationFilter filter)
| Method Detail |
public void transform(org.apache.bcel.classfile.JavaClass javaclass)
throws AbortTransformationException
javaclass - a class to transform.
AbortTransformationExceptionpublic void insert(Transformation t)
t - a transformation to insert. Note: a Transformation can
be added to only one ClassTransformer. Henceforth,
t will be attached to this
ClassTransformation, overriding any previous
affiliation.public void append(Transformation t)
t - a transformation to insert. Note: a Transformation can
be added to only one ClassTransformer. Henceforth,
t will be attached to this
ClassTransformation, overriding any previous
affiliation.public int size()
public org.apache.bcel.classfile.JavaClass getCurrentClass()
transform method, so only Transformation objects
should call this method.
public org.apache.bcel.generic.ConstantPoolGen getConstantPoolGen()
transform method (when there is a
current class), so only Transformation objects should call this
method.
public MethodSet getMethodSet()
transform method, so only Transformation objects
should call this method.
public java.util.Hashtable getSharedInfo()
transform.
public org.apache.bcel.generic.InstructionFactory getInstructionFactory()
public void setInstructionFactory(org.apache.bcel.generic.InstructionFactory factory)
transform(JavaClass) method, so it is not
neccessary to reset the factory after every class is transformed.
factory - the new instruction factory.public void setInstrumentationFilter(InstrumentationFilter filter)
filter - the new filter.getInstrumentationFilter()public InstrumentationFilter getInstrumentationFilter()
setInstrumentationFilter(InstrumentationFilter)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||