xdoclet
Class DocletTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byxjavadoc.ant.XJavadocTask
              extended byxdoclet.DocletTask
All Implemented Interfaces:
org.apache.tools.ant.DynamicConfigurator
Direct Known Subclasses:
DocumentDocletTask, EjbDocletTask, HibernateDocletTask, JdoDocletTask, JMXDocletTask, MockObjectDocletTask, PortletDocletTask, SpringDocletTask, TapestryDocletTask, WebDocletTask, WseeDocletTask

public class DocletTask
extends xjavadoc.ant.XJavadocTask
implements org.apache.tools.ant.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.

Author:
Ara Abrahamian (ara_e@email.com), Aslak Helles�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
           
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
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(org.apache.tools.ant.types.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 setExcludedTags(String tags)
          Deprecated.  
 void setExcludePackageNames(String src)
          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
 
Methods inherited from class xjavadoc.ant.XJavadocTask
createIgnoredtag, execute, getClasspath, getXJavaDoc, setDocencoding, setEncoding, setIgnoredtags, setValidating
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XDOCLET_VERSION

public static final String XDOCLET_VERSION
See Also:
Constant Field Values
Constructor Detail

DocletTask

public DocletTask()
Method Detail

getSubTaskName

public static String getSubTaskName(Class subTaskClass)

getPackageSubstitutions

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

Returns:
The PackageSubstitutions value

getConfigParams

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

Returns:
The ConfigParams value

getConfigParamsAsMap

public Map getConfigParamsAsMap()

getMergeDir

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

Returns:
The MergeDir value

getExcludedTags

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

Returns:
The ExcludedTags value

getDestDir

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

Returns:
The DestDir 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

getAddedTags

public String getAddedTags()

setPackageSubstitutions

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

Parameters:
packageSubstitutions - The new PackageSubstitutions value
ant.element

setDynamicAttribute

public void setDynamicAttribute(String name,
                                String value)
Specified by:
setDynamicAttribute in interface org.apache.tools.ant.DynamicConfigurator
Parameters:
name -
value -

setPackageNames

public void setPackageNames(String src)
Deprecated.  

Sets the PackageNames attribute of the DocletTask object

Parameters:
src - The new PackageNames value
ant.element

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

setDestDir

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

Parameters:
dir - The new DestDir 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

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

setVerbose

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

Parameters:
verbose - The new 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 -

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

addFileset

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

Parameters:
set - a fileset to add

createDynamicElement

public Object createDynamicElement(String name)
                            throws org.apache.tools.ant.BuildException
Specified by:
createDynamicElement in interface org.apache.tools.ant.DynamicConfigurator
Parameters:
name -
Returns:
Throws:
org.apache.tools.ant.BuildException

addSubTask

public void addSubTask(SubTask subtask)
Generic subtask.

Parameters:
subtask - The subtask to be added
ant.element

addTemplate

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

Parameters:
subtask - Describe the method parameter
Throws:
org.apache.tools.ant.BuildException
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

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

getSubTasks

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

Returns:
The SubTasks 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

start

protected void start()
              throws org.apache.tools.ant.BuildException
Throws:
org.apache.tools.ant.BuildException

validateOptions

protected void validateOptions()
                        throws org.apache.tools.ant.BuildException
Called by superclass before start() is called

Throws:
org.apache.tools.ant.BuildException - Describe the exception

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 -

validateSubTasks

protected void validateSubTasks()
                         throws org.apache.tools.ant.BuildException
Describe what the method does

Throws:
org.apache.tools.ant.BuildException - Describe the exception

http://xdoclet.sourceforge.net/