xdoclet
Class SubTask

java.lang.Object
  extended byxdoclet.DocletSupport
      extended byxdoclet.SubTask
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TemplateSubTask, VendorExtensionsSubTask

public abstract class SubTask
extends DocletSupport
implements Serializable

An abstract base class for all sub-tasks. Common code and the contract is defined here.

Because of the way Ant is designed all setter methods automatically are settable config parameters. Note that by default init() method inherits default setting from the containing task via DocletContext. Setter methods in sub-task gives the user finer control over config parameters of the sub-task.

Version:
$Revision: 1.75 $
Author:
Ara Abrahamian (ara_e@email.com)
See Also:
Serialized Form
created
June 16, 2001

Field Summary
 
Fields inherited from class xdoclet.DocletSupport
currentClassTag, currentFieldTag, currentMethodTag
 
Constructor Summary
SubTask()
           
 
Method Summary
 void addConfigParam(ConfigParameter configParam)
          Specifies a configuration parameter for the subtask.
 void copyAttributesFrom(TemplateSubTask src)
          Describe what the method does
abstract  void execute()
          Called to start execution of the sub-task.
 List getConfigParams()
          Gets the ConfigParams attribute of the SubTask object
 Map getConfigParamsAsMap()
           
protected  DocletContext getContext()
          A utility method that deleges the call to DocletContext.getSingleInstance().
 File getDestDir()
          Gets the DestDir attribute of the SubTask object
 File getMergeDir()
          Gets the MergeDir attribute of the SubTask object
 String getSubTaskName()
          Gets the SubTaskName attribute of the SubTask object
protected  xjavadoc.XJavaDoc getXJavaDoc()
           
 void init(xjavadoc.XJavaDoc xJavaDoc)
          Initializes SubTask.
 void setDestDir(File destDir)
          Sets the directory where the generated file(s) will be written.
 void setMergeDir(File mergeDir)
          Specifies the location of the merge directory.
 void setSubTaskName(String subTaskName)
          Sets an optional name for the subtask that will be seen in XDoclet's debug messages.
 void validateOptions()
          Called to validate configuration parameters.
 
Methods inherited from class xdoclet.DocletSupport
getCurrentClass, getCurrentClassTag, getCurrentConstructor, getCurrentField, getCurrentFieldTag, getCurrentMethod, getCurrentMethodTag, getCurrentPackage, getCurrentTag, isDocletGenerated, popCurrentClass, pushCurrentClass, setCurrentClass, setCurrentClassTag, setCurrentConstructor, setCurrentField, setCurrentFieldTag, setCurrentMethod, setCurrentMethodTag, setCurrentPackage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubTask

public SubTask()
Method Detail

getSubTaskName

public final String getSubTaskName()
Gets the SubTaskName attribute of the SubTask object

Returns:
The SubTaskName value

getConfigParams

public List getConfigParams()
Gets the ConfigParams attribute of the SubTask object

Returns:
The ConfigParams value

getConfigParamsAsMap

public Map getConfigParamsAsMap()

getDestDir

public File getDestDir()
Gets the DestDir attribute of the SubTask object

Returns:
The DestDir value

getMergeDir

public File getMergeDir()
Gets the MergeDir attribute of the SubTask object

Returns:
The MergeDir value

setSubTaskName

public void setSubTaskName(String subTaskName)
Sets an optional name for the subtask that will be seen in XDoclet's debug messages.

Parameters:
subTaskName -

setDestDir

public void setDestDir(File destDir)
Sets the directory where the generated file(s) will be written.

Parameters:
destDir - The new DestDir value

setMergeDir

public void setMergeDir(File mergeDir)
Specifies the location of the merge directory. This is where XDoclet will look for merge files.

Parameters:
mergeDir - The new MergeDir value

addConfigParam

public void addConfigParam(ConfigParameter configParam)
Specifies a configuration parameter for the subtask.

Parameters:
configParam - Describe the method parameter

copyAttributesFrom

public void copyAttributesFrom(TemplateSubTask src)
Describe what the method does

Parameters:
src - Describe what the parameter does

init

public void init(xjavadoc.XJavaDoc xJavaDoc)
          throws XDocletException
Initializes SubTask. It inherits values of the config parameters if not explicitly defined for this sub-task.

Parameters:
xJavaDoc -
Throws:
XDocletException - Description of Exception
See Also:
execute()

execute

public abstract void execute()
                      throws XDocletException
Called to start execution of the sub-task.

Throws:
XDocletException - Description of Exception

validateOptions

public void validateOptions()
                     throws XDocletException
Called to validate configuration parameters.

Throws:
XDocletException - Description of Exception

getContext

protected DocletContext getContext()
A utility method that deleges the call to DocletContext.getSingleInstance().

Returns:
the singleton context object

getXJavaDoc

protected xjavadoc.XJavaDoc getXJavaDoc()

http://xdoclet.sourceforge.net/