Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.ucsb.ccs.jcontractor.extras
Class jContractorTask  view jContractorTask download jContractorTask.java

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.apache.tools.ant.taskdefs.Java
              extended byedu.ucsb.ccs.jcontractor.extras.jContractorTask

public class jContractorTask
extends org.apache.tools.ant.taskdefs.Java

Ant task definition for jContractor. This task accepts all the options that the Java task does. (Note, however, that jContractor has never been tested with a Jar, and probably wouldn't work in this case.)

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.)
   verbose     Toggles verbose logging.  When      no
               verbose logging is enabled,
               jInstrument prints the name of
               each class as it is instrumented. 
 
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. The task also accepts all parameters that the Java task accepts.

Example:

   <jContractor classname="MainClass" verbose="false">
        <none package="*"/>
        <pre  package="mypackage.*"/>
        <all  package="mypackage.MyReallyImportantClass"/>
        <arg value="cmd_line_arg1"/>
        <arg value="cmd_line_arg2"/>
   </jContractor>
 

Version:
$Id: jContractorTask.java,v 1.3 2002/03/29 07:37:04 parkera Exp $

Field Summary
protected  java.lang.String classname
          The name of the class that jContractor will invoke.
protected  org.apache.tools.ant.types.Commandline cmdl
          Command line to hold arguments that will be passed to the class that jContractor invokes.
protected  java.util.Vector instrumentationFilters
          Vector of PackageLevelInstrumentationFilterType that will hold the parameters needed to construct a bunch of PackageLevelInstrumentationFilters.
protected  boolean verbose
          Verbose flag.
 
Fields inherited from class org.apache.tools.ant.taskdefs.Java
redirector, redirectorElement
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
jContractorTask()
          Create a new jContractorTask.
 
Method Summary
 void clearArgs()
          Clear the arguments that will be passed to the task that jContractor invokes.
 PackageLevelInstrumentationFilterType createAll()
          Create a <all package="..."/> tag.
 org.apache.tools.ant.types.Commandline.Argument createArg()
          Creates a nested arg element.
 PackageLevelInstrumentationFilterType createNone()
          Create a <none package="..."/> tag.
 PackageLevelInstrumentationFilterType createPost()
          Create a <post package="..."/> tag.
 PackageLevelInstrumentationFilterType createPre()
          Create a <pre package="..."/> tag.
 void execute()
          Execute jContractor to instrument and run the class named classname, with the specified command line arguments.
 java.lang.String getClassname()
          Get the name of the class that jContractor will invoke.
 boolean getVerbose()
          Get the value of the verbose flag.
 void setArgs(java.lang.String s)
          Set the arguments that will be passed to the class that jContractor invokes.
protected  boolean setClassname_Precondition(java.lang.String name)
           
 void setClassname(java.lang.String name)
          Set the name of the class that jContractor will invoke.
 void setVerbose(boolean flag)
          Set the verbose flag.
 
Methods inherited from class org.apache.tools.ant.taskdefs.Java
addAssertions, addConfiguredRedirector, addEnv, addSysproperty, addSyspropertyset, createBootclasspath, createClasspath, createJvmarg, createPermissions, createWatchdog, executeJava, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, maybeSetResultPropertyValue, run, setAppend, setClasspath, setClasspathRef, setDir, setError, setErrorProperty, setFailonerror, setFork, setInput, setInputString, setJar, setJvm, setJvmargs, setJVMVersion, setLogError, setMaxmemory, setNewenvironment, setOutput, setOutputproperty, setResultProperty, setSpawn, setTimeout, setupRedirector
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cmdl

protected org.apache.tools.ant.types.Commandline cmdl
Command line to hold arguments that will be passed to the class that jContractor invokes.


verbose

protected boolean verbose
Verbose flag.


classname

protected java.lang.String classname
The name of the class that jContractor will invoke.


instrumentationFilters

protected java.util.Vector instrumentationFilters
Vector of PackageLevelInstrumentationFilterType that will hold the parameters needed to construct a bunch of PackageLevelInstrumentationFilters. Built from "none", "pre", "post", and "all" tags.

Constructor Detail

jContractorTask

public jContractorTask()
Create a new jContractorTask.

Method Detail

setClassname

public void setClassname(java.lang.String name)
Set the name of the class that jContractor will invoke.


setClassname_Precondition

protected boolean setClassname_Precondition(java.lang.String name)

getClassname

public java.lang.String getClassname()
Get the name of the class that jContractor will invoke.


createArg

public org.apache.tools.ant.types.Commandline.Argument createArg()
Creates a nested arg element.


setArgs

public void setArgs(java.lang.String s)
Set the arguments that will be passed to the class that jContractor invokes.


clearArgs

public void clearArgs()
Clear the arguments that will be passed to the task that jContractor invokes.


setVerbose

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


getVerbose

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


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 jContractor to instrument and run the class named classname, with the specified command line arguments.