Class ParanamerTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.thoughtworks.paranamer.ant.ParanamerTask
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprivate StringThe directory that contains the class files to modify.private booleanBoolean that is true when the classdir was set as an attribute of the target, and false otherwise.private StringThe pattern used to exclude java files from processing.private booleanBoolean that is true when the excludes was set as an attribute of the target, and false otherwise.private Collection<org.apache.tools.ant.types.FileSet> The collection of nested file sets containing the files to be processed.private StringThe pattern used to include java files to be processed within the specified source directory.private booleanBoolean that is true when the includes was set as an attribute of the target, and false otherwise.private StringThe directory that contains the java source from which to extract the parameter names.private booleanBoolean that is true when the srcdir was set as an attribute of the target, and false otherwise.Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFileset(org.apache.tools.ant.types.FileSet fileset) Called automatically by ant when an embedded fileset element is present.voidexecute()Execute the task.protected QdoxParanamerGeneratorProvide this as a method so that it can be overridden and custom QdoxParanamerGenerators can be returned in place of the default.voidsetClassdir(String classdir) Called automatically by ant when the classdir attribute is present.voidsetExcludes(String excludes) Called automatically by ant when the excludes attribute is present.voidsetIncludes(String includes) Called automatically by ant when the includes attribute is present.voidCalled 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, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Field Details
-
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 srcdirSetBoolean that is true when the srcdir was set as an attribute of the target, and false otherwise. -
classdir
The directory that contains the class files to modify. By default this is the current directory. -
classdirSet
private boolean classdirSetBoolean that is true when the classdir was set as an attribute of the target, and false otherwise. -
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 includesSetBoolean that is true when the includes was set as an attribute of the target, and false otherwise. -
excludes
The pattern used to exclude java files from processing. By default this is empty. -
excludesSet
private boolean excludesSetBoolean that is true when the excludes was set as an attribute of the target, and false otherwise. -
filesets
The collection of nested file sets containing the files to be processed.
-
-
Constructor Details
-
ParanamerTask
public ParanamerTask()
-
-
Method Details
-
execute
public void execute() throws org.apache.tools.ant.BuildExceptionExecute the task.- Overrides:
executein 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
Called automatically by ant when the srcdir attribute is present.- Parameters:
srcdir- the content of the srcdir attribute.
-
setIncludes
Called automatically by ant when the includes attribute is present.- Parameters:
includes- the content of the includes attribute.
-
setExcludes
Called automatically by ant when the excludes attribute is present.- Parameters:
excludes- the content of the excludes attribute.
-
setClassdir
Called automatically by ant when the classdir attribute is present.- Parameters:
classdir- the content of the classdir attribute.
-
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.
-