org.acmsl.contractchecker
Class ContractCheckerTask

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.MatchingTask
                    |
                    +--org.acmsl.contractchecker.ContractCheckerTask
All Implemented Interfaces:
org.apache.tools.ant.types.selectors.SelectorContainer

public class ContractCheckerTask
extends org.apache.tools.ant.taskdefs.MatchingTask

Generates ContractChecker aspects and weaves them using Ant.

Version:
$Revision: 1.8 $
Author:
Jose San Leandro

Field Summary
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset, useDefaultExcludes
 
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
ContractCheckerTask()
          Creates a ContractCheckerTask.
 
Method Summary
 void addSourceRoots(java.io.File file)
          Adds a new file to the source path.
 org.apache.tools.ant.types.Path createClasspath()
          Creates the classpath.
 org.apache.tools.ant.types.Path createSourceRoots()
          Creates the source-roots path.
 void execute()
          Requests the ContractChecker compilation to be performed.
 void executeDoclet(java.io.File aspectOutput, java.lang.String violationException)
          Requests the Javadoc task invokation to generate the aspects using ContractCheckerDoclet.
protected  org.aspectj.tools.ant.taskdefs.AjcTask getAjcTask()
          Retrieves the AjcTask.
 java.io.File getAspectoutput()
          Retrieves the output folder for the generated aspects.
 org.apache.tools.ant.types.Path getClasspath()
          Retrieves the classpath.
 org.apache.tools.ant.types.Path getSourceRoots()
          Retrieves the source roots.
protected  java.io.File getTempBasedAspectOutput()
          Defines the output folder for classes, using the operating system temporary folder.
 java.lang.String getTemplatefactoryclass()
          Retrieves the template factory class.
 java.lang.String getViolationexception()
          Retrieves the contract violation exception.
protected  void setAjcTask(org.aspectj.tools.ant.taskdefs.AjcTask task)
          Specifies the AjcTask.
 void setAspectoutput(java.io.File aspectOutput)
          Specifies the output folder for the generated aspects.
 void setClasspath(org.apache.tools.ant.types.Path classpath)
          Specifies the classpath.
 void setClasspathref(org.apache.tools.ant.types.Reference ref)
          Specifies the classpath reference.
 void setCompliance(java.lang.String compliance)
          Specifies the language compliance level.
 void setCopyInjars(boolean doCopy)
          Specifies whether to copy all non-.class contents of injars to outjar after compile completes.
 void setDebug(boolean debug)
          Specifies the debug flag.
 void setDebugLevel(java.lang.String level)
          Specifies the debug level.
 void setDeprecation(boolean deprecation)
          Specifies the deprecation flag.
 void setDestdir(java.io.File dir)
          Specifies the destination folder.
 void setEmacssym(boolean emacssym)
          Specifies the emacssym flag.
 void setEncoding(java.lang.String encoding)
          Specifies the encoding.
 void setFailonerror(boolean failOnError)
          Specifies the fail-on-error flag.
 void setFork(boolean fork)
          Specifies the fork setting.
 void setHelp(boolean help)
          Specifies the help flag.
 void setIncremental(boolean incremental)
          Specifies the incremental behaviour.
 void setListFileArgs(boolean listFileArgs)
          Specifies the list-file-args flag.
 void setLog(java.io.File file)
          Specifies the log file.
 void setMaxmem(java.lang.String maxMem)
          Specifies the maxMem flag.
 void setNoExit(boolean noExit)
          Specifies the no-exit flag.
 void setNoImportError(boolean noImportError)
          Specifies the no-import-error flag.
 void setNowarn(boolean nowarn)
          Specifies the nowarn flag.
 void setOutjar(java.io.File file)
          Specifies the outjar file.
 void setPreserveAllLocals(boolean preserveAllLocals)
          Specifies the preserve-all-locals flag.
 void setProceedOnError(boolean proceedOnError)
          Specifies the proceed-on-error flag.
 void setProgress(boolean progress)
          Specifies the progress.
 void setReferenceInfo(boolean referenceInfo)
          Specifies the reference info.
 void setSource(java.lang.String source)
          Specifies the source compliance level.
 void setSourceRootCopyFilter(java.lang.String filter)
          Specifies whether to copy all files from all source root directories except those specified here.
 void setSourceRoots(org.apache.tools.ant.types.Path roots)
          Specifies the source roots.
 void setSourcerootsref(org.apache.tools.ant.types.Reference ref)
          Specifies the source roots reference.
 void setTagFile(java.io.File file)
          Specifies the tag file.
 void setTarget(java.lang.String target)
          Specifies the target.
 void setTemplatefactoryclass(java.lang.String factoryClass)
          Specifies the template factory class.
 void setTime(boolean time)
          Specifies the time flag.
 void setVerbose(boolean verbose)
          Specifies the verbose flag.
 void setVersion(boolean version)
          Specifies the version flag.
 void setViolationexception(java.lang.String exception)
          Specifies the contract violation exception.
 void setWarn(java.lang.String warnings)
          Specifies the warnings.
 void setX(java.lang.String input)
          Specifies the X option.
 void setXlint(java.lang.String xlint)
          Specifies the Xlint value.
 void setXlintfile(java.io.File xlintFile)
          Specifies the xlint file.
 void setXlintwarnings(boolean xlintwarnings)
          Specifies the Xlint warnings.
 void setXNoweave(boolean noweave)
          Specifies the xnoweave flag.
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
addAnd, addContains, addCustom, addDate, addDepend, addDepth, addFilename, addMajority, addNone, addNot, addOr, addPresent, addSelector, addSize, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContractCheckerTask

public ContractCheckerTask()
Creates a ContractCheckerTask.

Method Detail

setAjcTask

protected void setAjcTask(org.aspectj.tools.ant.taskdefs.AjcTask task)
Specifies the AjcTask.

Parameters:
task - the task.

getAjcTask

protected org.aspectj.tools.ant.taskdefs.AjcTask getAjcTask()
Retrieves the AjcTask.

Returns:
such task.

setAspectoutput

public void setAspectoutput(java.io.File aspectOutput)
Specifies the output folder for the generated aspects.

Parameters:
aspectOutput - such folder.

getAspectoutput

public java.io.File getAspectoutput()
Retrieves the output folder for the generated aspects.

Returns:
such folder.

getTempBasedAspectOutput

protected java.io.File getTempBasedAspectOutput()
                                         throws java.io.IOException
Defines the output folder for classes, using the operating system temporary folder.

Returns:
the new folder.
Throws:
java.io.IOException - if the temporary folder could not be created.

setTemplatefactoryclass

public void setTemplatefactoryclass(java.lang.String factoryClass)
Specifies the template factory class.

Parameters:
factoryClass - the new template factory class.

getTemplatefactoryclass

public java.lang.String getTemplatefactoryclass()
Retrieves the template factory class.

Returns:
such class.

setViolationexception

public void setViolationexception(java.lang.String exception)
Specifies the contract violation exception.

Parameters:
exception - such exception.

getViolationexception

public java.lang.String getViolationexception()
Retrieves the contract violation exception.

Returns:
such exception.

setIncremental

public void setIncremental(boolean incremental)
Specifies the incremental behaviour.

Parameters:
incremental - such behaviour.

setHelp

public void setHelp(boolean help)
Specifies the help flag.

Parameters:
help - such flag.

setVersion

public void setVersion(boolean version)
Specifies the version flag.

Parameters:
version - such flag.

setXNoweave

public void setXNoweave(boolean noweave)
Specifies the xnoweave flag.

Parameters:
noweave - such flag.

setNowarn

public void setNowarn(boolean nowarn)
Specifies the nowarn flag.

Parameters:
nowarn - such flag.

setDeprecation

public void setDeprecation(boolean deprecation)
Specifies the deprecation flag.

Parameters:
deprecation - such flag.

setWarn

public void setWarn(java.lang.String warnings)
Specifies the warnings.

Parameters:
warnings - the list of warnings.

setDebug

public void setDebug(boolean debug)
Specifies the debug flag.

Parameters:
debug - such flag.

setDebugLevel

public void setDebugLevel(java.lang.String level)
Specifies the debug level.

Parameters:
level - such level.

setEmacssym

public void setEmacssym(boolean emacssym)
Specifies the emacssym flag.

Parameters:
emacssym - such flag.

setXlintwarnings

public void setXlintwarnings(boolean xlintwarnings)
Specifies the Xlint warnings.


setXlint

public void setXlint(java.lang.String xlint)
Specifies the Xlint value.

Parameters:
xlint - such value.

setXlintfile

public void setXlintfile(java.io.File xlintFile)
Specifies the xlint file.

Parameters:
xlintFile - such file.

setPreserveAllLocals

public void setPreserveAllLocals(boolean preserveAllLocals)
Specifies the preserve-all-locals flag.

Parameters:
preserveAllLocals - such flag.

setNoImportError

public void setNoImportError(boolean noImportError)
Specifies the no-import-error flag.

Parameters:
noImportError - such flag.

setEncoding

public void setEncoding(java.lang.String encoding)
Specifies the encoding.

Parameters:
encoding - such value.

setLog

public void setLog(java.io.File file)
Specifies the log file.

Parameters:
file - such file.

setProceedOnError

public void setProceedOnError(boolean proceedOnError)
Specifies the proceed-on-error flag.

Parameters:
proceedOnError - such flag.

setVerbose

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

Parameters:
verbose - such flag.

setListFileArgs

public void setListFileArgs(boolean listFileArgs)
Specifies the list-file-args flag.

Parameters:
listFileArgs - such flag.

setReferenceInfo

public void setReferenceInfo(boolean referenceInfo)
Specifies the reference info.

Parameters:
referenceInfo - such value.

setProgress

public void setProgress(boolean progress)
Specifies the progress.

Parameters:
progress - such value.

setTime

public void setTime(boolean time)
Specifies the time flag.

Parameters:
time - such value.

setNoExit

public void setNoExit(boolean noExit)
Specifies the no-exit flag.

Parameters:
noExit - such flag.

setFailonerror

public void setFailonerror(boolean failOnError)
Specifies the fail-on-error flag.

Parameters:
failOnError - such flag.

setFork

public void setFork(boolean fork)
Specifies the fork setting.

Parameters:
fork - such setting.

setMaxmem

public void setMaxmem(java.lang.String maxMem)
Specifies the maxMem flag.

Parameters:
maxMem - such flag.

setTagFile

public void setTagFile(java.io.File file)
Specifies the tag file.

Parameters:
file - such file.

setOutjar

public void setOutjar(java.io.File file)
Specifies the outjar file.


setDestdir

public void setDestdir(java.io.File dir)
Specifies the destination folder.

Parameters:
dir - such dir.

setTarget

public void setTarget(java.lang.String target)
Specifies the target.

Parameters:
target - the target.

setCompliance

public void setCompliance(java.lang.String compliance)
Specifies the language compliance level.

Parameters:
compliance - either "1.3" or "1.4"

setSource

public void setSource(java.lang.String source)
Specifies the source compliance level.

Parameters:
source - either "1.3" or "1.4"

setCopyInjars

public void setCopyInjars(boolean doCopy)
Specifies whether to copy all non-.class contents of injars to outjar after compile completes. Requires both injars and outjar.

Parameters:
doCopy - such flag.

setSourceRootCopyFilter

public void setSourceRootCopyFilter(java.lang.String filter)
Specifies whether to copy all files from all source root directories except those specified here. If this is specified and sourceroots are specified, then this will copy all files except those specified in the filter pattern. Requires sourceroots.

Parameters:
filter - a String acceptable as an excludes filter for an Ant Zip fileset.

setX

public void setX(java.lang.String input)
Specifies the X option.

Parameters:
input - such option.

setSourceRoots

public void setSourceRoots(org.apache.tools.ant.types.Path roots)
Specifies the source roots.

Parameters:
roots - such path.

getSourceRoots

public org.apache.tools.ant.types.Path getSourceRoots()
Retrieves the source roots.

Returns:
such path.

createSourceRoots

public org.apache.tools.ant.types.Path createSourceRoots()
Creates the source-roots path.

Returns:
such path.

addSourceRoots

public void addSourceRoots(java.io.File file)
Adds a new file to the source path.

Parameters:
file - the new file.

setSourcerootsref

public void setSourcerootsref(org.apache.tools.ant.types.Reference ref)
Specifies the source roots reference.

Parameters:
ref - such reference.

setClasspath

public void setClasspath(org.apache.tools.ant.types.Path classpath)
Specifies the classpath.

Parameters:
classpath - such path.

getClasspath

public org.apache.tools.ant.types.Path getClasspath()
Retrieves the classpath.

Returns:
such path.

createClasspath

public org.apache.tools.ant.types.Path createClasspath()
Creates the classpath.

Returns:
such path.

setClasspathref

public void setClasspathref(org.apache.tools.ant.types.Reference ref)
Specifies the classpath reference.

Parameters:
ref - such reference.

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Requests the ContractChecker compilation to be performed.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException - whenever the required parameters are not present or valid.

executeDoclet

public void executeDoclet(java.io.File aspectOutput,
                          java.lang.String violationException)
                   throws org.apache.tools.ant.BuildException
Requests the Javadoc task invokation to generate the aspects using ContractCheckerDoclet.

Parameters:
aspectOutput - the output folder for the aspects.
violationException - the contract violation exception.
Throws:
org.apache.tools.ant.BuildException - if the doclet could not be executed.


Copyright © 2003-2004 ACM S.L.. All Rights Reserved.