net.sourceforge.retroweaver.ant
Class RetroWeaverTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by net.sourceforge.retroweaver.ant.RetroWeaverTask
All Implemented Interfaces:
java.lang.Cloneable

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

An Ant task for running RetroWeaver on a set of class files.


Nested Class Summary
static class RetroWeaverTask.Namespace
          NameSpace in translator package is immutable.
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
RetroWeaverTask()
           
 
Method Summary
 void addDirSet(org.apache.tools.ant.types.DirSet pFileSet)
           
 void addFileSet(org.apache.tools.ant.types.FileSet pFileSet)
          Add a set of files to be weaved.
 org.apache.tools.ant.types.Path createClasspath()
          Gets the classpath to be used for verification.
 RetroWeaverTask.Namespace createNameSpace()
           
 boolean doVerify()
          Turn off verification if desired
 void execute()
          Run the RetroWeaver task.
 java.lang.String getInputJar()
           
 java.lang.String getOutputJar()
           
 void setClasspath(org.apache.tools.ant.types.Path classpath)
          Set the classpath to be used for verification.
 void setClasspathRef(org.apache.tools.ant.types.Reference r)
          Adds a reference to a classpath defined elsewhere.
 void setDestDir(java.io.File pDir)
          Set the destination directory for processed classes.
 void setFailOnError(boolean pFailOnError)
          Specify if an error should cause the script to fail.
 void setInputJar(java.lang.String inputJar)
           
 void setLazy(boolean pLazy)
          Specify if classes should only be processed if their current version differ from the target version.
 void setOutputJar(java.lang.String outputJar)
           
 void setSrcDir(java.io.File pDir)
          Set the source directory containing classes to process.
 void setStripAttributes(boolean stripAttributes)
           
 void setStripSignatures(boolean stripSignatures)
           
 void setTarget(java.lang.String target)
          Set the target class file version.
 void setVerbose(boolean pVerbose)
          Specify if each processed class should be logged.
 void setVerify(boolean newVerify)
          Turn off verification if desired
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetroWeaverTask

public RetroWeaverTask()
Method Detail

setDestDir

public void setDestDir(java.io.File pDir)
Set the destination directory for processed classes. Unless specified the classes are processed in place.

Parameters:
pDir - The destination directory.

setFailOnError

public void setFailOnError(boolean pFailOnError)
Specify if an error should cause the script to fail. Default to true.

Parameters:
pFailOnError - true to fail, false to keep going.

addFileSet

public void addFileSet(org.apache.tools.ant.types.FileSet pFileSet)
Add a set of files to be weaved.

Parameters:
pSet - The fileset.

addDirSet

public void addDirSet(org.apache.tools.ant.types.DirSet pFileSet)

setLazy

public void setLazy(boolean pLazy)
Specify if classes should only be processed if their current version differ from the target version. Initially true.

Parameters:
pLazy - true for lazy processing.

setSrcDir

public void setSrcDir(java.io.File pDir)
Set the source directory containing classes to process. This is a shortcut to using an embedded fileset with the specified base directory and which includes all class files.

Parameters:
pDir - The directory.

setVerbose

public void setVerbose(boolean pVerbose)
Specify if each processed class should be logged. Initially set to false.

Parameters:
pVerbose - true for verbose processing.

setTarget

public void setTarget(java.lang.String target)
Set the target class file version. Initially set to "1.4".

Parameters:
target - The JDK target version, e g "1.3".

setClasspath

public void setClasspath(org.apache.tools.ant.types.Path classpath)
Set the classpath to be used for verification. Retroweaver will report any references to fields/methods/classes which don't appear on refClassPath.

Parameters:
classpath - an Ant Path object containing the compilation classpath.

createClasspath

public org.apache.tools.ant.types.Path createClasspath()
Gets the classpath to be used for verification.

Returns:
the class path public Path getClasspath() { return verifyClasspath; } /** Adds a path to the classpath.

setClasspathRef

public void setClasspathRef(org.apache.tools.ant.types.Reference r)
Adds a reference to a classpath defined elsewhere.

Parameters:
r - a reference to a classpath

setVerify

public void setVerify(boolean newVerify)
Turn off verification if desired


doVerify

public boolean doVerify()
Turn off verification if desired

Returns:
is verification enabled?

createNameSpace

public RetroWeaverTask.Namespace createNameSpace()

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Run the RetroWeaver task.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException - If a build exception occurs.

getInputJar

public java.lang.String getInputJar()
Returns:
Returns the inputJar.

setInputJar

public void setInputJar(java.lang.String inputJar)
Parameters:
inputJar - The inputJar to set.

getOutputJar

public java.lang.String getOutputJar()
Returns:
Returns the outputJar.

setOutputJar

public void setOutputJar(java.lang.String outputJar)
Parameters:
outputJar - The outputJar to set.

setStripSignatures

public void setStripSignatures(boolean stripSignatures)
Parameters:
stripSignatures - The stripSignatures to set.

setStripAttributes

public void setStripAttributes(boolean stripAttributes)
Parameters:
stripAttributes - The stripAttributes to set