|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object xdoclet.DocletSupport xdoclet.SubTask xdoclet.TemplateSubTask
Generic subtask for processing a user-supplied template. The template is specified in the templateFile
configuration parameter. It operates in two modes: per class and single output.
Nested Class Summary | |
static class |
TemplateSubTask.ExtentTypes
|
static class |
TemplateSubTask.OfType
Applicable only to per class output generation. |
Field Summary |
Fields inherited from class xdoclet.DocletSupport |
currentClassTag, currentFieldTag, currentMethodTag |
Constructor Summary | |
TemplateSubTask()
|
Method Summary | |
protected void |
addOfType(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()
|
String |
getDestinationFile()
Gets the DestinationFile attribute of the TemplateSubTask object |
TemplateEngine |
getEngine()
Gets the Engine attribute of the TemplateSubTask object |
String |
getExtent()
Gets the Extent attribute of the TemplateSubTask object |
protected String |
getGeneratedFileName(xjavadoc.XClass clazz)
Returns the filename of the generated file for a class. |
GenerationManager |
getGenerationManager()
|
String |
getHavingClassTag()
Gets the HavingClassTag attribute of the TemplateSubTask object |
String[] |
getOfType()
Gets the OfType attribute of the TemplateSubTask object |
ArrayList |
getPackageSubstitutions()
Gets the PackageSubstitutions attribute of the TemplateSubTask object |
String |
getSubTaskClassName()
Gets the SubTaskClassName attribute of the TemplateSubTask object |
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 String |
javaFile(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(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(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(String havingClassTag)
Sets the HavingClassTag attribute of the TemplateSubTask object |
void |
setOfType(String ofType)
|
void |
setPackageSubstitutionInheritanceSupported(boolean packageSubstitutionInheritanceSupported)
Indicates whether or not package substitution should be inherited |
void |
setPackageSubstitutions(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(String subTaskClassName)
Sets the SubTaskClassName attribute of the TemplateSubTask object |
void |
setTemplateFile(File templateFile)
Sets the name of the template file to use for generation |
void |
setTemplateURL(URL templateURL)
This method should be called to set a template file programmatically. |
protected void |
startEngine(URL templateURL,
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. |
Methods inherited from class xdoclet.SubTask |
addConfigParam, getConfigParams, getConfigParamsAsMap, getContext, getDestDir, getMergeDir, getSubTaskName, getXJavaDoc, setDestDir, setMergeDir, setSubTaskName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TemplateSubTask()
Method Detail |
protected static String javaFile(String className)
className
- class name
public boolean getAcceptInterfaces()
public boolean getAcceptAbstractClasses()
public GenerationManager getGenerationManager()
public ArrayList getPackageSubstitutions()
public boolean isPackageSubstitutionInheritanceSupported()
public String getSubTaskClassName()
public TemplateEngine getEngine()
public URL getTemplateURL()
public String getDestinationFile()
public String[] getOfType()
public String getExtent()
public String getHavingClassTag()
public boolean isPrefixWithPackageStructure()
public void setAcceptInterfaces(boolean acceptInterfaces)
acceptInterfaces
- public void setAcceptAbstractClasses(boolean acceptAbstractClasses)
acceptAbstractClasses
- public void setPackageSubstitutions(ArrayList packageSubstitutions)
packageSubstitutions
- The new PackageSubstitutions valuepublic void setPackageSubstitutionInheritanceSupported(boolean packageSubstitutionInheritanceSupported)
packageSubstitutionInheritanceSupported
- The new PackageSubstitutionInheritanceSupported valuepublic void setSubTaskClassName(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(String destinationFile)
destinationFile
- The new DestinationFile valuepublic void setTemplateURL(URL templateURL)
templateURL
- public void setTemplateFile(File templateFile) throws XDocletException
templateFile
- the file name (real file!) of the template
XDocletException
public void setExtent(TemplateSubTask.ExtentTypes extent)
extent
- The new Extent valuepublic void setHavingClassTag(String havingClassTag)
havingClassTag
- The new HavingClassTag valuepublic void setOfType(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 String getGeneratedFileName(xjavadoc.XClass clazz) throws XDocletException
clazz
- the class being processed
XDocletException
- Description of Exceptionprotected void setGenerationManager(GenerationManager gM)
gM
- The new GenerationManager valueprotected void setExtentValue(String extent)
extent
- The new ExtentValue valueprotected final void startEngine(URL templateURL, File outputFile) throws TemplateException
templateURL
- Describe what the parameter doesoutputFile
- Describe what the parameter does
TemplateException
- Describe the exceptionprotected void addOfType(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 Parameter
XDocletException
- Description of Exceptionprotected void generateForClass(xjavadoc.XClass clazz) throws XDocletException
clazz
- Description of Parameter
XDocletException
- Description of Exceptionprotected void engineStarted() throws XDocletException
XDocletException
- Describe the exceptionprotected void engineFinished() throws TemplateException
TemplateException
- Describe the exception
|
http://xdoclet.sourceforge.net/ | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |