edu.ucsb.ccs.jcontractor.extras
Class jInstrumentTask

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--edu.ucsb.ccs.jcontractor.extras.jInstrumentTask

public class jInstrumentTask
extends org.apache.tools.ant.Task

Ant task definition for jInstrument.

Parameters:

   Attribute   Description                         Required
   ---------   -----------                         --------
   none        A package that is not to be         no
               instrumented. (Nested element.)
   pre         A package to be instrumented with   no
               precondition checks. (Nested
               element.)
   post        A package to be instrumented with   no
               pre and postcondition checks.
               (Nested element.)
   all         A package to be instrumented with   no
               all checks (pre, post, invariant).
               (Nested element.)
   srcdir      A directory containing Java class   yes
               files to instrument.  All classes
               in this directory and all
               subdirectories will be processed.
   destdir     The directory to which instrumented no
               files will be written. Default is
               the directory of the build file.
   verbose     Toggles verbose logging.  When      no
               verbose logging is enabled,
               jInstrument prints the name of
               each class as it is instrumented. 
   strip       Instructs jInstrument to remove     no
               contract methods from bytecode, in
               order to decrease the file size.
 
The arguments to "none", "pre", "post", and "all" are the names of packages, with class names or wildcards. A "*" instead a class name (as in "edu.*") means to match any class in that package or a subpackage. To match all classes in any package, simply pass "*". If only a class name is given the default package is assumed ("jInstrument" is the same as ".jInstrument"). The example below should make every thing clear.

Example:

   <jInstrument srcdir="${build.dest}" verbose="false">

      <none package="*"/>
      <pre  package="mypackage.*"/>
      <all  package="mypackage.MyReallyImportantClass"/>
   </jInstrument>
 

Version:
$Id: jInstrumentTask.java,v 1.13 2003/01/26 10:49:58 parkera Exp $
Author:
Parker Abercrombie
See Also:
jContractorTask

Constructor Summary
jInstrumentTask()
          Create a new jInstrumentTask.
 
Method Summary
 PackageLevelInstrumentationFilterType createAll()
          Create a <all package="..."/> tag.
 PackageLevelInstrumentationFilterType createNone()
          Create a <none package="..."/> tag.
 PackageLevelInstrumentationFilterType createPost()
          Create a <post package="..."/> tag.
 PackageLevelInstrumentationFilterType createPre()
          Create a <pre package="..."/> tag.
 void execute()
          Execute jInstrument to instrument each class file in the directory specified by srcdir.
 java.lang.String getDestdir()
          Get the destination directory of instrumented class files.
 org.apache.tools.ant.types.Path getSrcdir()
          Get the source directory.
 boolean getStrip()
          Get the value of the strip mode flag.
 boolean getVerbose()
          Get the value of the verbose flag.
 void setDestdir(java.lang.String destination)
          Set the destination directory of instrumented class files.
 void setSrcdir(org.apache.tools.ant.types.Path newSrcdir)
          Set the source directory.
 void setStrip(boolean flag)
          Set the value of the strip mode flag.
 void setVerbose(boolean flag)
          Set the verbose flag.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

jInstrumentTask

public jInstrumentTask()
Create a new jInstrumentTask.

Method Detail

setSrcdir

public void setSrcdir(org.apache.tools.ant.types.Path newSrcdir)
Set the source directory. jInstrument will be run to instrument all the class files in this directory and all subdirectories.

Parameters:
newSrcdir - the new source directory.
See Also:
getSrcdir()

getSrcdir

public org.apache.tools.ant.types.Path getSrcdir()
Get the source directory.

See Also:
setSrcdir(Path)

setDestdir

public void setDestdir(java.lang.String destination)
Set the destination directory of instrumented class files.

Parameters:
destination - the new destination.

getDestdir

public java.lang.String getDestdir()
Get the destination directory of instrumented class files.

Returns:
the destination directory.

setVerbose

public void setVerbose(boolean flag)
Set the verbose flag.

Parameters:
flag - the new value of the flag.

getVerbose

public boolean getVerbose()
Get the value of the verbose flag.

Returns:
the verbose flag.

setStrip

public void setStrip(boolean flag)
Set the value of the strip mode flag. When this flag is set, jInstrument is run to remove contract methods from bytecode.


getStrip

public boolean getStrip()
Get the value of the strip mode flag. When this flag is set, jInstrument is run to remove contract methods from bytecode.


createNone

public PackageLevelInstrumentationFilterType createNone()
Create a <none package="..."/> tag.


createPre

public PackageLevelInstrumentationFilterType createPre()
Create a <pre package="..."/> tag.


createPost

public PackageLevelInstrumentationFilterType createPost()
Create a <post package="..."/> tag.


createAll

public PackageLevelInstrumentationFilterType createAll()
Create a <all package="..."/> tag.


execute

public void execute()
             throws org.apache.tools.ant.BuildException
Execute jInstrument to instrument each class file in the directory specified by srcdir.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException - if the "srcdir" attribute was not set.