xdoclet

Class SubTask

Implemented Interfaces:
Serializable
Known Direct Subclasses:
TemplateSubTask

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)

created
June 16, 2001

Field Summary

Fields inherited from class xdoclet.DocletSupport

currentClassTag, currentFieldTag, currentMethodTag

Method Summary

void
addConfigParam(ConfigParameter configParam)
Specifies a configuration parameter for the subtask.
void
copyAttributesFrom(TemplateSubTask src)
Describe what the method does
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
getXJavaDoc()
void
init(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

Method Details

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


execute

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

Throws:
XDocletException - Description of Exception


getConfigParams

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

Returns:
The ConfigParams value


getConfigParamsAsMap

public Map getConfigParamsAsMap()


getContext

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

Returns:
the singleton context object


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


getSubTaskName

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

Returns:
The SubTaskName value


getXJavaDoc

protected XJavaDoc getXJavaDoc()


init

public void init(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()


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


setSubTaskName

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

Parameters:
subTaskName -


validateOptions

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

Throws:
XDocletException - Description of Exception