org.aspectj.tools.ant.taskdefs
Class Ajc2

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.MatchingTask
                    |
                    +--org.apache.tools.ant.taskdefs.Javac
                          |
                          +--org.aspectj.tools.ant.taskdefs.Ajc2
All Implemented Interfaces:
org.apache.tools.ant.types.selectors.SelectorContainer

public class Ajc2
extends org.apache.tools.ant.taskdefs.Javac

Ant task for the AspectJ compiler -- AJC. List (.lst) files are passed in as includes. This task was developed by the AspectJ Project

Author:
Jeffrey Palm
See Also:
org.aspectj.tools.ant.taskdefs.compilers.AjcCompiler

Inner Class Summary
static class Ajc2.Argfile
          A simple class with one member -- file -- that represents an argument file.
 
Inner classes inherited from class org.apache.tools.ant.taskdefs.Javac
org.apache.tools.ant.taskdefs.Javac.ImplementationSpecificArgument
 
Field Summary
static java.lang.String ADAPTER_CLASS
          The name of the adapter we use.
 
Fields inherited from class org.apache.tools.ant.taskdefs.Javac
compileList, failOnError, listFiles
 
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
Ajc2()
           
 
Method Summary
 Ajc2.Argfile createArgfile()
          Creates a nested Argfile, add it to the list argfiles, and returns the new Argfile instance.
 org.apache.tools.ant.types.PatternSet.NameEntry createExclude()
          Override Javac.createExclude() to set haveExcludes to true.
 org.apache.tools.ant.types.PatternSet.NameEntry createInclude()
          Override Javac.createInclude() to set haveIncludes to true.
 void execute()
           
 void executeAfterPrepare()
          Executes by first setting the build.compiler property to AjcCompiler, then invokes the super.execute() method.
 java.lang.String getAdapterClass()
           
 java.util.List getArgfiles()
          Returns the java.util.List of argfiles.
 boolean getNocomments()
          Returns if the -nocomments flag is turned on.
 boolean getNosymbols()
          Returns if the -nosymbols flag is turned on.
 boolean getPreprocess()
          Returns if the -preprocess flag is turned on.
 java.lang.Integer getThreads()
          Returns the number of threads.
 java.io.File getWorkingdir()
          Returns the current workingdir.
protected  boolean hasExcludes()
          Whether we have used the excludes attribute.
protected  boolean hasIncludes()
          Whether we have used the includes attribute.
 void prepare()
          Guaranteed to be called before doing real execute.
protected  void scanDir(java.io.File srcDir, java.io.File destDir, java.lang.String[] files)
          Overrides Javac.scanDir(..) so that it doesn't check dependencies.
 void setArgfiles(java.lang.String argfiles)
          Sets the the argument files by the comma-delimited String passed in.
 void setExcludes(java.lang.String excludes)
          Override Javac.setExcludes(String) to set haveExcludes to true.
 void setIncludes(java.lang.String includes)
          Override Javac.setIncludes(String) to set haveIncludes to true.
 void setNocomments(boolean nocomments)
          Set the -nocomments flag.
 void setNosymbols(boolean nosymbols)
          Set the -nosymbols flag.
 void setPreprocess(boolean preprocess)
          Returns if the -preprocess flag is turned on.
 void setThreads(java.lang.Integer threads)
          Sets the number of threads.
 void setWorkingdir(java.io.File workingdir)
          Sets the workingdir.
protected  void useDefaultSrcdir()
           
 
Methods inherited from class org.apache.tools.ant.taskdefs.Javac
checkParameters, compile, createBootclasspath, createClasspath, createCompilerArg, createExtdirs, createSourcepath, createSrc, getBootclasspath, getClasspath, getCompiler, getCompilerVersion, getCurrentCompilerArgs, getDebug, getDebugLevel, getDepend, getDeprecation, getDestdir, getEncoding, getExtdirs, getFailonerror, getFileList, getIncludeantruntime, getIncludejavaruntime, getJavacExecutable, getListfiles, getMemoryInitialSize, getMemoryMaximumSize, getNowarn, getOptimize, getSource, getSourcepath, getSrcdir, getSystemJavac, getTarget, getVerbose, isForkedJavac, isJdkCompiler, recreateSrc, resetFileLists, setBootclasspath, setBootClasspathRef, setClasspath, setClasspathRef, setCompiler, setDebug, setDebugLevel, setDepend, setDeprecation, setDestdir, setEncoding, setExecutable, setExtdirs, setFailonerror, setFork, setIncludeantruntime, setIncludejavaruntime, setListfiles, setMemoryInitialSize, setMemoryMaximumSize, setNowarn, setOptimize, setProceed, setSource, setSourcepath, setSourcepathRef, setSrcdir, setTarget, setVerbose
 
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, createExcludesFile, createIncludesFile, createPatternSet, getDirectoryScanner, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludesfile, setFollowSymlinks, 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
 

Field Detail

ADAPTER_CLASS

public static final java.lang.String ADAPTER_CLASS
The name of the adapter we use.
Constructor Detail

Ajc2

public Ajc2()
Method Detail

hasExcludes

protected boolean hasExcludes()
Whether we have used the excludes attribute.
Returns:
Whether we have used the excludes attribute.

hasIncludes

protected boolean hasIncludes()
Whether we have used the includes attribute.
Returns:
Whether we have used the includes attribute.

setThreads

public void setThreads(java.lang.Integer threads)
Sets the number of threads.
Parameters:
threads - the number of threads.
See Also:
Ajc2#threads

getThreads

public java.lang.Integer getThreads()
Returns the number of threads.
Returns:
the number of threads.
See Also:
Ajc2#threads

setNocomments

public void setNocomments(boolean nocomments)
Set the -nocomments flag.
Parameters:
nocomments - true turns on the flag.
See Also:
Ajc2#nocomments

getNocomments

public boolean getNocomments()
Returns if the -nocomments flag is turned on.
Returns:
true if the -nocomments flag is on.
See Also:
Ajc2#nocomments

setNosymbols

public void setNosymbols(boolean nosymbols)
Set the -nosymbols flag.
Parameters:
nosymbols - true turns on the flag.
See Also:
Ajc2#nosymbols

getNosymbols

public boolean getNosymbols()
Returns if the -nosymbols flag is turned on.
Returns:
true if the -nosymbols flag is on.
See Also:
Ajc2#nosymbols

setPreprocess

public void setPreprocess(boolean preprocess)
Returns if the -preprocess flag is turned on.
Returns:
true if the -preprocess flag is on.
See Also:
Ajc2#preprocess

getPreprocess

public boolean getPreprocess()
Returns if the -preprocess flag is turned on.
Returns:
true if the -preprocess flag is on.
See Also:
Ajc2#preprocess

setWorkingdir

public void setWorkingdir(java.io.File workingdir)
Sets the workingdir.
Parameters:
workingdir - the new workingdir.
See Also:
Ajc2#workingdir

getWorkingdir

public java.io.File getWorkingdir()
Returns the current workingdir.
Returns:
the current workingdir.
See Also:
Ajc2#workingdir

setArgfiles

public void setArgfiles(java.lang.String argfiles)
Sets the the argument files by the comma-delimited String passed in.
Parameters:
argfiles - comma-delimited String contained argument files.

createArgfile

public Ajc2.Argfile createArgfile()
Creates a nested Argfile, add it to the list argfiles, and returns the new Argfile instance.
Returns:
a new Argfile instance.

getArgfiles

public java.util.List getArgfiles()
Returns the java.util.List of argfiles. This could be null.
Returns:
the list of argfiles.

createInclude

public org.apache.tools.ant.types.PatternSet.NameEntry createInclude()
Override Javac.createInclude() to set haveIncludes to true.
Overrides:
createInclude in class org.apache.tools.ant.taskdefs.MatchingTask
Returns:
new PatternSet.NameEntry to be added to the include list.
See Also:
org.apache.tools.taskdefs.Javac#createInclude()

createExclude

public org.apache.tools.ant.types.PatternSet.NameEntry createExclude()
Override Javac.createExclude() to set haveExcludes to true.
Overrides:
createExclude in class org.apache.tools.ant.taskdefs.MatchingTask
Returns:
new PatternSet.NameEntry to be added to the exclude list.
See Also:
org.apache.tools.taskdefs.Javac#createExclude()

setIncludes

public void setIncludes(java.lang.String includes)
Override Javac.setIncludes(String) to set haveIncludes to true.
Overrides:
setIncludes in class org.apache.tools.ant.taskdefs.MatchingTask
Parameters:
includes - Comma-separated list of includes.
See Also:
org.apache.tools.taskdefs.Javac#setIncludes(java.lang.String)

setExcludes

public void setExcludes(java.lang.String excludes)
Override Javac.setExcludes(String) to set haveExcludes to true.
Overrides:
setExcludes in class org.apache.tools.ant.taskdefs.MatchingTask
Parameters:
excludes - Comma-separated list of excludes.
See Also:
org.apache.tools.taskdefs.Javac#setExcludes(java.lang.String)

getAdapterClass

public java.lang.String getAdapterClass()

execute

public final void execute()
                   throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.taskdefs.Javac

executeAfterPrepare

public void executeAfterPrepare()
                         throws org.apache.tools.ant.BuildException
Executes by first setting the build.compiler property to AjcCompiler, then invokes the super.execute() method.
Throws:
org.apache.tools.ant.BuildException -  
See Also:
Javac.execute()

prepare

public void prepare()
Guaranteed to be called before doing real execute.

useDefaultSrcdir

protected final void useDefaultSrcdir()

scanDir

protected void scanDir(java.io.File srcDir,
                       java.io.File destDir,
                       java.lang.String[] files)
Overrides Javac.scanDir(..) so that it doesn't check dependencies.
Overrides:
scanDir in class org.apache.tools.ant.taskdefs.Javac
See Also:
Javac.scanDir(java.io.File, java.io.File, java.lang.String[])