xdoclet
Class TemplateSubTask
java.lang.Object
|
+--xdoclet.DocletSupport
|
+--xdoclet.SubTask
|
+--xdoclet.TemplateSubTask
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- AbstractEjbCodeGeneratorSubTask, DocumentTagsSubTask, InfoSubTask, MBeanInterfaceSubTask, MLetSubTask, NoInnerClassSubTask, OpenJMXDescriptionAdapterSubTask, WebWorkActionDocsSubTask, WebWorkConfigPropertiesSubTask, XmlSubTask
- public class TemplateSubTask
- extends SubTask
Generates The template file specified in templateFile configuration
parameter. It operates in two modes: per class and single output.
- Version:
- $Revision: 1.29 $
- Author:
- Ara Abrahamian (ara_e@email.com)
- See Also:
- Serialized Form
Methods inherited from class xdoclet.DocletSupport |
getCurrentClass, getCurrentConstructor, getCurrentField, getCurrentMethod, getCurrentPackage, getCurrentTag, isDocletGenerated, popCurrentClass, pushCurrentClass, setCurrentClass, setCurrentConstructor, setCurrentField, setCurrentMethod, setCurrentPackage, setCurrentTag |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SUBTASK_NAME
public static final java.lang.String SUBTASK_NAME
TemplateSubTask
public TemplateSubTask()
javaFile
protected static java.lang.String javaFile(java.lang.String className)
- Converts the full qualified class name to a valid path with File.separator
characters instead of . characters and class name postfixed by a ".java".
- Parameters:
className
- Description of Parameter- Returns:
- Description of the Returned Value
getPackageSubstitutions
public java.util.Vector getPackageSubstitutions()
isGuessGenerationNeeded
public boolean isGuessGenerationNeeded()
isPackageSubstitutionInheritanceSupported
public boolean isPackageSubstitutionInheritanceSupported()
- By default supports, but some subtasks may not support because global
packageSubstitution is for public interfaces/classes, not good for impl
classes.
- Returns:
- true
getSubTaskClassName
public java.lang.String getSubTaskClassName()
getEngine
public TemplateEngine getEngine()
getParser
public TemplateParser getParser()
getTemplateURL
public java.net.URL getTemplateURL()
getDestinationFile
public java.lang.String getDestinationFile()
getOfType
public java.lang.String getOfType()
getExtent
public java.lang.String getExtent()
getHavingClassTag
public java.lang.String getHavingClassTag()
getSubTaskName
public java.lang.String getSubTaskName()
- Overrides:
getSubTaskName
in class SubTask
isPrefixWithPackageStructure
public boolean isPrefixWithPackageStructure()
setGuessGenerationNeeded
public void setGuessGenerationNeeded(boolean guessGenerationNeeded)
setPackageSubstitutions
public void setPackageSubstitutions(java.util.Vector packageSubstitutions)
setPackageSubstitutionInheritanceSupported
public void setPackageSubstitutionInheritanceSupported(boolean packageSubstitutionInheritanceSupported)
setSubTaskClassName
public void setSubTaskClassName(java.lang.String subTaskClassName)
setPrefixWithPackageStructure
public void setPrefixWithPackageStructure(boolean prefixWithPackageStructure)
setEngine
public void setEngine(TemplateEngine engine)
setParser
public void setParser(TemplateParser parser)
setDestinationFile
public void setDestinationFile(java.lang.String destinationFile)
setTemplateURL
public void setTemplateURL(java.net.URL templateFile)
- This method should be called to set a template file programmatically. The
URL is typically obtained with a getClass().getResource( templateName )
- Parameters:
templateFile
- the URL of the template file
setTemplateFile
public void setTemplateFile(java.io.File templateFile)
- This method is called from Ant in Don't
call this explicitly, use the URL method instead.
- Parameters:
templateFile
- the file name (real file!) of the template
setOfType
public void setOfType(java.lang.String ofType)
setExtent
public void setExtent(TemplateSubTask.ExtentTypes extent)
setHavingClassTag
public void setHavingClassTag(java.lang.String havingClassTag)
addPackageSubstitution
public void addPackageSubstitution(PackageTagsHandler.PackageSubstitution ps)
- Adds a set of files (nested fileset attribute).
- Parameters:
ps
- The feature to be added to the Fileset attribute
copyAttributesFrom
public void copyAttributesFrom(TemplateSubTask src)
init
public void init()
throws XDocletException
- Description copied from class:
SubTask
- Initializes SubTask. It inherits values of the config parameters if not
explicitly defined for this sub-task.
- Overrides:
init
in class SubTask
- Following copied from class:
xdoclet.SubTask
- Throws:
XDocletException
- Description of Exception- See Also:
SubTask.execute()
validateOptions
public void validateOptions()
throws XDocletException
- Called to validate configuration parameters.
- Overrides:
validateOptions
in class SubTask
- Throws:
XDocletException
- Description of Exception
execute
public void execute()
throws XDocletException
- Description copied from class:
SubTask
- Called to start execution of the sub-task.
- Overrides:
execute
in class SubTask
- Following copied from class:
xdoclet.SubTask
- Throws:
XDocletException
- Description of Exception
getGeneratedFileName
protected java.lang.String getGeneratedFileName(com.sun.javadoc.ClassDoc clazz)
throws XDocletException
- Returns class name for the generated file. {0} substituted by class name.
- Parameters:
clazz
- Description of Parameter- Returns:
- The GeneratedClassName value
- Throws:
XDocletException
- Description of Exception
setExtentValue
protected void setExtentValue(java.lang.String extent)
startProcess
protected void startProcess()
throws XDocletException
matchesGenerationRules
protected boolean matchesGenerationRules(com.sun.javadoc.ClassDoc clazz)
throws XDocletException
- Returns true if output not already generated for clazz, and is of the
specified type and has the specified class tag; false otherwise. If returned
false, no output file is generated for clazz.
- Parameters:
clazz
- Description of Parameter- Returns:
- Description of the Returned Value
- Throws:
XDocletException
- Description of Exception
generateForClass
protected void generateForClass(com.sun.javadoc.ClassDoc clazz)
throws XDocletException
- Processed template for clazz and generates output file for clazz.
- Parameters:
clazz
- Description of Parameter- Throws:
XDocletException
- Description of Exception
engineStarted
protected void engineStarted()
throws XDocletException
engineFinished
protected void engineFinished()
throws TemplateException
beanFile
protected java.io.File beanFile(com.sun.javadoc.ClassDoc clazz)
throws XDocletException
- Returns the File pointing to where current class is stored.
- Parameters:
clazz
- Description of Parameter- Returns:
- Description of the Returned Value
- Throws:
XDocletException
-
startEngine
protected void startEngine(java.net.URL templateURL,
java.io.File output_file)
throws TemplateException