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

    Fields
    Modifier and Type
    Field
    Description
    private String
    The directory that contains the class files to modify.
    private boolean
    Boolean that is true when the classdir was set as an attribute of the target, and false otherwise.
    private String
    The pattern used to exclude java files from processing.
    private boolean
    Boolean 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 String
    The pattern used to include java files to be processed within the specified source directory.
    private boolean
    Boolean that is true when the includes was set as an attribute of the target, and false otherwise.
    private String
    The directory that contains the java source from which to extract the parameter names.
    private boolean
    Boolean 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, wrapper

    Fields inherited from class org.apache.tools.ant.ProjectComponent

    description, location, project
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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 the task.
    Provide this as a method so that it can be overridden and custom QdoxParanamerGenerators can be returned in place of the default.
    void
    setClassdir(String classdir)
    Called automatically by ant when the classdir attribute is present.
    void
    setExcludes(String excludes)
    Called automatically by ant when the excludes attribute is present.
    void
    setIncludes(String includes)
    Called automatically by ant when the includes attribute is present.
    void
    setSrcdir(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

    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
  • Field Details

    • srcdir

      private 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 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 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 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 Collection<org.apache.tools.ant.types.FileSet> 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.BuildException
      Execute the task.
      Overrides:
      execute in class org.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(String srcdir)
      Called automatically by ant when the srcdir attribute is present.
      Parameters:
      srcdir - the content of the srcdir attribute.
    • setIncludes

      public void setIncludes(String includes)
      Called automatically by ant when the includes attribute is present.
      Parameters:
      includes - the content of the includes attribute.
    • setExcludes

      public void setExcludes(String excludes)
      Called automatically by ant when the excludes attribute is present.
      Parameters:
      excludes - the content of the excludes attribute.
    • setClassdir

      public void setClassdir(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.