xdoclet

Class DocletTask

Implemented Interfaces:
DynamicConfigurator

public class DocletTask
extends XJavadocTask
implements DynamicConfigurator

A base class for all Tasks. It can also be used directly, useful for the case where you want to execute a template file but you don't want to bother writing a new task.

Authors:
Ara Abrahamian (ara_e@email.com)
Aslak Helleso?=y

ant.element
name = "xdoclet" display-name = "XDoclet Standard Task"

ant.attribute
name = "encoding" description = "Specify the source file encoding name, such as Windows-31J, EUC-JP, UTF-8. In default, system default encoding is used."
name = "docencoding" description = "Specify encoding name for template engine. The generated file encoding may be this value. In default, system default encoding is used."

created
June 19, 2001

Field Summary

static String
XDOCLET_VERSION

Constructor Summary

DocletTask()

Method Summary

void
addConfigParam(ConfigParameter configParam)
Allows to set configuration parameters that will be included in the element as attribute value pair.
void
addFileset(FileSet set)
Ant's <fileset> definition.
void
addPackageSubstitution(PackageTagsHandler.PackageSubstitution ps)
Substitutes the package of the generated files.
void
addSubTask(SubTask subtask)
Generic subtask.
void
addTemplate(TemplateSubTask subtask)
Generic subtask for processing a user-supplied template.
void
addXmlTemplate(XmlSubTask subtask)
Generic subtask for processing a user-supplied template, to generate an XML document.
protected void
checkClass(String className)
Throws BuildException if a specific class is not on the CP.
Object
createDynamicElement(String name)
String
getAddedTags()
List
getConfigParams()
Gets the ConfigParams attribute of the DocletTask object
protected HashMap
getConfigParams(List subtasks)
Gets the ConfigParams attribute of the DocletTask object
Map
getConfigParamsAsMap()
File
getDestDir()
Gets the DestDir attribute of the DocletTask object
String
getExcludedTags()
Gets the ExcludedTags attribute of the DocletTask object
File
getMergeDir()
Gets the MergeDir attribute of the DocletTask object
List
getPackageSubstitutions()
Gets the PackageSubstitutions attribute of the EjbDocletTask object
static String
getSubTaskName(Class subTaskClass)
protected List
getSubTasks()
Gets the SubTasks attribute of the DocletTask object
boolean
isForce()
Gets the Force attribute of the DocletTask object.
boolean
isVerbose()
Gets the Verbose attribute of the DocletTask object.
void
setAddedTags(String addedTags)
Add some JavaDoc tags (or comments) to the generated classes.
void
setDestDir(File dir)
Destination directory for output files
void
setDynamicAttribute(String name, String value)
void
setExcludePackageNames(String src)
Deprecated.
void
setExcludedTags(String tags)
Deprecated.
void
setForce(boolean force)
Specify if the generation of files should be forced.
void
setMergeDir(File dir)
Directory where subtasks will look for files to be merged with generated files.
void
setPackageNames(String src)
Deprecated.
void
setPackageSubstitutions(List packageSubstitutions)
Sets the PackageSubstitutions attribute of the EjbDocletTask object
void
setVerbose(boolean verbose)
Sets the Verbose attribute of the DocletTask object.
protected void
start()
protected void
validateOptions()
Called by superclass before start() is called
protected void
validateSubTasks()
Describe what the method does

Field Details

XDOCLET_VERSION

public static final String XDOCLET_VERSION

Constructor Details

DocletTask

public DocletTask()

Method Details

addConfigParam

public void addConfigParam(ConfigParameter configParam)
Allows to set configuration parameters that will be included in the element as attribute value pair.

Parameters:
configParam - Describe the method parameter


addFileset

public void addFileset(FileSet set)
Ant's <fileset> definition. To define the files to parse.

Parameters:
set - a fileset to add


addPackageSubstitution

public void addPackageSubstitution(PackageTagsHandler.PackageSubstitution ps)
Substitutes the package of the generated files.

Parameters:
ps - The feature to be added to the Fileset attribute


addSubTask

public void addSubTask(SubTask subtask)
Generic subtask.

Parameters:
subtask - The subtask to be added

ant.element


addTemplate

public void addTemplate(TemplateSubTask subtask)
            throws BuildException
Generic subtask for processing a user-supplied template.

Parameters:
subtask - Describe the method parameter

ant.element


addXmlTemplate

public void addXmlTemplate(XmlSubTask subtask)
Generic subtask for processing a user-supplied template, to generate an XML document.

Parameters:
subtask - Describe the method parameter

ant.element


checkClass

protected void checkClass(String className)
Throws BuildException if a specific class is not on the CP. Should be called from subclasses' validateOptions() to verify that classpath is OK.

Parameters:
className -


createDynamicElement

public Object createDynamicElement(String name)
            throws BuildException

Parameters:
name -

Returns:


getAddedTags

public String getAddedTags()


getConfigParams

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

Returns:
The ConfigParams value


getConfigParams

protected HashMap getConfigParams(List subtasks)
Gets the ConfigParams attribute of the DocletTask object

Parameters:
subtasks - Describe what the parameter does

Returns:
The ConfigParams value


getConfigParamsAsMap

public Map getConfigParamsAsMap()


getDestDir

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

Returns:
The DestDir value


getExcludedTags

public String getExcludedTags()
Gets the ExcludedTags attribute of the DocletTask object

Returns:
The ExcludedTags value


getMergeDir

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

Returns:
The MergeDir value


getPackageSubstitutions

public List getPackageSubstitutions()
Gets the PackageSubstitutions attribute of the EjbDocletTask object

Returns:
The PackageSubstitutions value


getSubTaskName

public static String getSubTaskName(Class subTaskClass)


getSubTasks

protected final List getSubTasks()
Gets the SubTasks attribute of the DocletTask object

Returns:
The SubTasks value


isForce

public boolean isForce()
Gets the Force attribute of the DocletTask object.

Returns:
The Force value


isVerbose

public boolean isVerbose()
Gets the Verbose attribute of the DocletTask object.

Returns:
The Verbose value


setAddedTags

public void setAddedTags(String addedTags)
Add some JavaDoc tags (or comments) to the generated classes. A special case @ xdoclet-generated. If this is included, ejbdoclet will not consider the file if it is by error in the fileset of the ejbdoclet task.

Parameters:
addedTags -


setDestDir

public void setDestDir(File dir)
Destination directory for output files

Parameters:
dir - The new DestDir value

ant.not-required
Onlyifit's notspecifiedfor asubtask.


setDynamicAttribute

public void setDynamicAttribute(String name,
                                String value)

Parameters:
name -
value -


setExcludePackageNames

public void setExcludePackageNames(String src)

Deprecated.

Sets the ExcludePackageNames attribute of the DocletTask object

Parameters:
src - The new ExcludePackageNames value

ant.element


setExcludedTags

public void setExcludedTags(String tags)

Deprecated.

Specify tags that should not be automatically written to output files. The normal behaviour is to include all @ tags from the source file to the output files. This may cause trouble if you use cvs-like tag like $Revision: 1.5 $ that will be overwritten at each build and causes a difference for CVS even if the code himself is not changed. Example: excludedtags="@ version" For excluded tags, ejbdoclet will generate an hardcoded tag. Example: @ version XDOCLET 1.0

Parameters:
tags - The new ExcludedTags value


setForce

public void setForce(boolean force)
Specify if the generation of files should be forced. In normal cases, the timestamp of generated file is checked against the timestamps of the class (and its super classes) we generate from. When this timestamp checking should be bypassed (for example after the installtion of a new xdoclet version) then the user should force the regeneration. The easiest way is to run the Ant build file with a parameter "-Dxdoclet.force=true" and add the option "force=${xdoclet.force}" to the doclet call.

Parameters:
force - The new Force value


setMergeDir

public void setMergeDir(File dir)
Directory where subtasks will look for files to be merged with generated files.

Parameters:
dir - The new MergeDir value

ant.not-required
No,butshould besetif youwantto usethemerge feature.


setPackageNames

public void setPackageNames(String src)

Deprecated.

Sets the PackageNames attribute of the DocletTask object

Parameters:
src - The new PackageNames value

ant.element


setPackageSubstitutions

public void setPackageSubstitutions(List packageSubstitutions)
Sets the PackageSubstitutions attribute of the EjbDocletTask object

Parameters:
packageSubstitutions - The new PackageSubstitutions value

ant.element


setVerbose

public void setVerbose(boolean verbose)
Sets the Verbose attribute of the DocletTask object.

Parameters:
verbose - The new Verbose value


start

protected void start()
            throws BuildException


validateOptions

protected void validateOptions()
            throws BuildException
Called by superclass before start() is called


validateSubTasks

protected void validateSubTasks()
            throws BuildException
Describe what the method does