Package com.thoughtworks.paranamer.ant
Class ParanamerTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- com.thoughtworks.paranamer.ant.ParanamerTask
-
- All Implemented Interfaces:
java.lang.Cloneable
public class ParanamerTask extends org.apache.tools.ant.Task
Ant Task to process parameter names. This ant task facilitates the specification of the java source and class files to process as attributes, nested file sets or a combination of both. The attributes applicable to this ant task include a source directory, class directory, include pattern and exclude pattern. i.e.: <paranamer srcdir="src" classdir="classes" includes="*.java" excludes="excluded.java"/> Each of these attributes contains a default: - srcdir: the base directory of the project - classdir: srcdir - includes: "
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
classdir
The directory that contains the class files to modify.private boolean
classdirSet
Boolean that is true when the classdir was set as an attribute of the target, and false otherwise.private java.lang.String
excludes
The pattern used to exclude java files from processing.private boolean
excludesSet
Boolean that is true when the excludes was set as an attribute of the target, and false otherwise.private java.util.Collection<org.apache.tools.ant.types.FileSet>
filesets
The collection of nested file sets containing the files to be processed.private java.lang.String
includes
The pattern used to include java files to be processed within the specified source directory.private boolean
includesSet
Boolean that is true when the includes was set as an attribute of the target, and false otherwise.private java.lang.String
srcdir
The directory that contains the java source from which to extract the parameter names.private boolean
srcdirSet
Boolean that is true when the srcdir was set as an attribute of the target, and false otherwise.
-
Constructor Summary
Constructors Constructor Description ParanamerTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFileset(org.apache.tools.ant.types.FileSet fileset)
Called automatically by ant when an embedded fileset element is present.void
execute()
Execute the task.protected QdoxParanamerGenerator
makeQdoxParanamerGenerator()
Provide this as a method so that it can be overridden and custom QdoxParanamerGenerators can be returned in place of the default.void
setClassdir(java.lang.String classdir)
Called automatically by ant when the classdir attribute is present.void
setExcludes(java.lang.String excludes)
Called automatically by ant when the excludes attribute is present.void
setIncludes(java.lang.String includes)
Called automatically by ant when the includes attribute is present.void
setSrcdir(java.lang.String srcdir)
Called automatically by ant when the srcdir attribute is present.-
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
-
-
-
-
Field Detail
-
srcdir
private java.lang.String srcdir
The directory that contains the java source from which to extract the parameter names. By default this is the current directory.
-
srcdirSet
private boolean srcdirSet
Boolean that is true when the srcdir was set as an attribute of the target, and false otherwise.
-
classdir
private java.lang.String classdir
The directory that contains the class files to modify. By default this is the current directory.
-
classdirSet
private boolean classdirSet
Boolean that is true when the classdir was set as an attribute of the target, and false otherwise.
-
includes
private java.lang.String includes
The pattern used to include java files to be processed within the specified source directory. By default this is the set of java files in the current directory and all its sub-directories. This is to match the default matching semantics of the fileset target.
-
includesSet
private boolean includesSet
Boolean that is true when the includes was set as an attribute of the target, and false otherwise.
-
excludes
private java.lang.String excludes
The pattern used to exclude java files from processing. By default this is empty.
-
excludesSet
private boolean excludesSet
Boolean that is true when the excludes was set as an attribute of the target, and false otherwise.
-
filesets
private java.util.Collection<org.apache.tools.ant.types.FileSet> filesets
The collection of nested file sets containing the files to be processed.
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildException
Execute the task.- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
-
addFileset
public void addFileset(org.apache.tools.ant.types.FileSet fileset)
Called automatically by ant when an embedded fileset element is present.- Parameters:
fileset
- the fileset specification
-
setSrcdir
public void setSrcdir(java.lang.String srcdir)
Called automatically by ant when the srcdir attribute is present.- Parameters:
srcdir
- the content of the srcdir attribute.
-
setIncludes
public void setIncludes(java.lang.String includes)
Called automatically by ant when the includes attribute is present.- Parameters:
includes
- the content of the includes attribute.
-
setExcludes
public void setExcludes(java.lang.String excludes)
Called automatically by ant when the excludes attribute is present.- Parameters:
excludes
- the content of the excludes attribute.
-
setClassdir
public void setClassdir(java.lang.String classdir)
Called automatically by ant when the classdir attribute is present.- Parameters:
classdir
- the content of the classdir attribute.
-
makeQdoxParanamerGenerator
protected QdoxParanamerGenerator makeQdoxParanamerGenerator()
Provide this as a method so that it can be overridden and custom QdoxParanamerGenerators can be returned in place of the default. This is used for testing purposes.- Returns:
- the qdox paranamer generated instance to use to generate the paranamer data.
-
-