xdoclet
public class TemplateSubTask extends SubTask
templateFile
configuration parameter. It operates in two modes: per class and single output.Modifier and Type | Class and Description |
---|---|
static class |
TemplateSubTask.ExtentTypes |
static class |
TemplateSubTask.OfType
Applicable only to per class output generation.
|
currentClassTag, currentFieldTag, currentMethodTag
Constructor and Description |
---|
TemplateSubTask() |
Modifier and Type | Method and Description |
---|---|
protected void |
addOfType(java.lang.String ofType) |
void |
addOfType(TemplateSubTask.OfType ofType) |
void |
addPackageSubstitution(PackageTagsHandler.PackageSubstitution ps)
Substitutes the package of the generated files.
|
void |
copyAttributesFrom(TemplateSubTask src)
Describe what the method does
|
protected void |
engineFinished()
Describe what the method does
|
protected void |
engineStarted()
Describe what the method does
|
void |
execute()
Describe what the method does
|
protected void |
generateForClass(xjavadoc.XClass clazz)
Processed template for clazz and generates output file for clazz.
|
boolean |
getAcceptAbstractClasses() |
boolean |
getAcceptInterfaces() |
java.lang.String |
getDestinationFile()
Gets the DestinationFile attribute of the TemplateSubTask object
|
TemplateEngine |
getEngine()
Gets the Engine attribute of the TemplateSubTask object
|
java.lang.String |
getExtent()
Gets the Extent attribute of the TemplateSubTask object
|
protected java.lang.String |
getGeneratedFileName(xjavadoc.XClass clazz)
Returns the filename of the generated file for a class.
|
GenerationManager |
getGenerationManager() |
java.lang.String |
getHavingClassTag()
Gets the HavingClassTag attribute of the TemplateSubTask object
|
java.lang.String[] |
getOfType()
Gets the OfType attribute of the TemplateSubTask object
|
java.util.ArrayList |
getPackageSubstitutions()
Gets the PackageSubstitutions attribute of the TemplateSubTask object
|
java.lang.String |
getSubTaskClassName()
Gets the SubTaskClassName attribute of the TemplateSubTask object
|
java.net.URL |
getTemplateURL()
Gets the TemplateURL attribute of the TemplateSubTask object
|
void |
init(xjavadoc.XJavaDoc xJavaDoc)
Describe what the method does
|
boolean |
isPackageSubstitutionInheritanceSupported()
By default supports, but some subtasks may not support because global packageSubstitution is for public
interfaces/classes, not good for impl classes.
|
boolean |
isPrefixWithPackageStructure()
Gets the PrefixWithPackageStructure attribute of the TemplateSubTask object
|
protected static java.lang.String |
javaFile(java.lang.String className)
Converts the fully qualified class name to a valid path with File.separator characters instead of "." characters
and class name postfixed by a ".java".
|
protected boolean |
matchesGenerationRules(xjavadoc.XClass clazz)
Returns true if output not already generated for clazz, and is of the specified type and has the specified class
tag; false otherwise.
|
protected boolean |
processInnerClasses()
Subclasses should override this method and return true if they want startProcessPerClass() to process inner
classes too.
|
void |
setAcceptAbstractClasses(boolean acceptAbstractClasses)
Indicates whether or not to generate for abstract classes.
|
void |
setAcceptInterfaces(boolean acceptInterfaces)
Indicates whether or not to generate for interfaces.
|
void |
setDestinationFile(java.lang.String destinationFile)
The destination file name.
|
void |
setEngine(TemplateEngine engine)
Sets the Engine attribute of the TemplateSubTask object
|
void |
setExtent(TemplateSubTask.ExtentTypes extent)
You can control the extent in which the type search occurs.
|
protected void |
setExtentValue(java.lang.String extent)
Sets the ExtentValue attribute of the TemplateSubTask object
|
protected void |
setGenerationManager(GenerationManager gM)
Sets the GenerationManager attribute of the TemplateSubTask object
|
void |
setHavingClassTag(java.lang.String havingClassTag)
Sets the HavingClassTag attribute of the TemplateSubTask object
|
void |
setOfType(java.lang.String ofType) |
void |
setPackageSubstitutionInheritanceSupported(boolean packageSubstitutionInheritanceSupported)
Indicates whether or not package substitution should be inherited
|
void |
setPackageSubstitutions(java.util.ArrayList packageSubstitutions)
Sets the PackageSubstitutions attribute of the TemplateSubTask object
|
void |
setPrefixWithPackageStructure(boolean prefixWithPackageStructure)
Indicates whether or not to prefix with package structure.
|
void |
setSubTaskClassName(java.lang.String subTaskClassName)
Sets the SubTaskClassName attribute of the TemplateSubTask object
|
void |
setTemplateFile(java.io.File templateFile)
Sets the name of the template file to use for generation
|
void |
setTemplateURL(java.net.URL templateURL)
This method should be called to set a template file programmatically.
|
protected void |
startEngine(java.net.URL templateURL,
java.io.File outputFile)
Describe what the method does
|
protected void |
startProcess()
Describe what the method does
|
protected void |
startProcessForAll() |
protected void |
startProcessPerClass() |
void |
validateOptions()
Called to validate configuration parameters.
|
addConfigParam, getConfigParams, getConfigParamsAsMap, getContext, getDestDir, getMergeDir, getSubTaskName, getXJavaDoc, setDestDir, setMergeDir, setSubTaskName
getCurrentClass, getCurrentClassTag, getCurrentConstructor, getCurrentField, getCurrentFieldTag, getCurrentMethod, getCurrentMethodTag, getCurrentPackage, getCurrentTag, isDocletGenerated, popCurrentClass, pushCurrentClass, setCurrentClass, setCurrentClassTag, setCurrentConstructor, setCurrentField, setCurrentFieldTag, setCurrentMethod, setCurrentMethodTag, setCurrentPackage
protected static java.lang.String javaFile(java.lang.String className)
className
- class namepublic boolean getAcceptInterfaces()
public boolean getAcceptAbstractClasses()
public GenerationManager getGenerationManager()
public java.util.ArrayList getPackageSubstitutions()
public boolean isPackageSubstitutionInheritanceSupported()
public java.lang.String getSubTaskClassName()
public TemplateEngine getEngine()
public java.net.URL getTemplateURL()
public java.lang.String getDestinationFile()
public java.lang.String[] getOfType()
public java.lang.String getExtent()
public java.lang.String getHavingClassTag()
public boolean isPrefixWithPackageStructure()
public void setAcceptInterfaces(boolean acceptInterfaces)
acceptInterfaces
- public void setAcceptAbstractClasses(boolean acceptAbstractClasses)
acceptAbstractClasses
- public void setPackageSubstitutions(java.util.ArrayList packageSubstitutions)
packageSubstitutions
- The new PackageSubstitutions valuepublic void setPackageSubstitutionInheritanceSupported(boolean packageSubstitutionInheritanceSupported)
packageSubstitutionInheritanceSupported
- The new PackageSubstitutionInheritanceSupported valuepublic void setSubTaskClassName(java.lang.String subTaskClassName)
subTaskClassName
- The new SubTaskClassName valuepublic void setPrefixWithPackageStructure(boolean prefixWithPackageStructure)
prefixWithPackageStructure
- The new PrefixWithPackageStructure valuepublic void setEngine(TemplateEngine engine)
engine
- The new Engine valuepublic void setDestinationFile(java.lang.String destinationFile)
destinationFile
- The new DestinationFile valuepublic void setTemplateURL(java.net.URL templateURL)
templateURL
- public void setTemplateFile(java.io.File templateFile) throws XDocletException
templateFile
- the file name (real file!) of the templateXDocletException
public void setExtent(TemplateSubTask.ExtentTypes extent)
extent
- The new Extent valuepublic void setHavingClassTag(java.lang.String havingClassTag)
havingClassTag
- The new HavingClassTag valuepublic void setOfType(java.lang.String ofType)
public void addOfType(TemplateSubTask.OfType ofType)
public void addPackageSubstitution(PackageTagsHandler.PackageSubstitution ps)
ps
- The feature to be added to the Fileset attributepublic void copyAttributesFrom(TemplateSubTask src)
copyAttributesFrom
in class SubTask
src
- Describe what the parameter doespublic void init(xjavadoc.XJavaDoc xJavaDoc) throws XDocletException
init
in class SubTask
xJavaDoc
- XDocletException
- Describe the exceptionSubTask.execute()
public void validateOptions() throws XDocletException
validateOptions
in class SubTask
XDocletException
- Description of Exceptionpublic void execute() throws XDocletException
execute
in class SubTask
XDocletException
- Describe the exceptionprotected java.lang.String getGeneratedFileName(xjavadoc.XClass clazz) throws XDocletException
clazz
- the class being processedXDocletException
- Description of Exceptionprotected void setGenerationManager(GenerationManager gM)
gM
- The new GenerationManager valueprotected void setExtentValue(java.lang.String extent)
extent
- The new ExtentValue valueprotected final void startEngine(java.net.URL templateURL, java.io.File outputFile) throws TemplateException
templateURL
- Describe what the parameter doesoutputFile
- Describe what the parameter doesTemplateException
- Describe the exceptionprotected void addOfType(java.lang.String ofType)
protected void startProcess() throws XDocletException
XDocletException
- Describe the exceptionprotected void startProcessForAll() throws XDocletException
XDocletException
protected boolean processInnerClasses()
protected void startProcessPerClass() throws XDocletException
XDocletException
protected boolean matchesGenerationRules(xjavadoc.XClass clazz) throws XDocletException
clazz
- Description of ParameterXDocletException
- Description of Exceptionprotected void generateForClass(xjavadoc.XClass clazz) throws XDocletException
clazz
- Description of ParameterXDocletException
- Description of Exceptionprotected void engineStarted() throws XDocletException
XDocletException
- Describe the exceptionprotected void engineFinished() throws TemplateException
TemplateException
- Describe the exception