org.quilt.cover.stmt
Class ClassAction

java.lang.Object
  |
  +--org.quilt.cover.stmt.ClassAction
All Implemented Interfaces:
ClassXformer

public class ClassAction
extends java.lang.Object
implements ClassXformer

Add instrumentation at the class level, creating <clinit> if necessary. Three fields are added and initialized:

All of these fields are public final static. They are initialized by clinit when the class is loaded, running bytecode inserted by Quilt.

Author:
Jim Dixon

Constructor Summary
ClassAction()
           
ClassAction(StmtRegistry reg)
           
 
Method Summary
 java.lang.String getName()
          Get the preprocessor's report name.
 void postMethods(org.apache.bcel.generic.ClassGen clazz)
          Postprocessor applied to the class after looking at methods.
 void preMethods(org.apache.bcel.generic.ClassGen clazz)
          Add a q$$q hit count field to the class using public static int [] q$$q; If there is already a field of this name, do not instrument the class.
 void setClassTransformer(ClassTransformer ct)
          Passes a reference to the controlling ClassTransformer.
 void setName(java.lang.String name)
          Set the preprocessor's name for reports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassAction

public ClassAction()

ClassAction

public ClassAction(StmtRegistry reg)
Method Detail

setClassTransformer

public void setClassTransformer(ClassTransformer ct)
Passes a reference to the controlling ClassTransformer. XXX Inelegant - and unnecessary. XXX REWORK TO USED stmtReg

Specified by:
setClassTransformer in interface ClassXformer

preMethods

public void preMethods(org.apache.bcel.generic.ClassGen clazz)
Add a q$$q hit count field to the class using public static int [] q$$q; If there is already a field of this name, do not instrument the class. This is a preprocessor applied to the class before looking at methods. Any such preprocessors will be applied in the order of the ClassXformer vector.

Specified by:
preMethods in interface ClassXformer
Parameters:
clazz - ClassGen for the class being transformed.

postMethods

public void postMethods(org.apache.bcel.generic.ClassGen clazz)
Postprocessor applied to the class after looking at methods. These will be applied in reverse order after completion of method processing.

Specified by:
postMethods in interface ClassXformer

getName

public java.lang.String getName()
Get the preprocessor's report name.

Specified by:
getName in interface ClassXformer

setName

public void setName(java.lang.String name)
Set the preprocessor's name for reports.

Specified by:
setName in interface ClassXformer


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.