xdoclet.modules.apache.struts

Class ActionFormSubTask

Implemented Interfaces:
Serializable

public class ActionFormSubTask
extends xdoclet.TemplateSubTask

Generates a Struts ActionForm, based on a POJO. More information on Struts is available on the Struts website , or the ActionForm API .
Version:
$Revision: 1.2 $
Author:
Matt Raible (matt@raibledesigns.com)
ant.element
display-name = "Action Form" name = "actionform" parent = "xdoclet.DocletTask"
created
April 26, 2004

Nested Class Summary

Nested classes/interfaces inherited from class xdoclet.TemplateSubTask

TemplateSubTask.ExtentTypes, TemplateSubTask.OfType

Field Summary

protected static String
DEFAULT_TEMPLATE_FILE
The default template file - struts_form.xdt.
protected XTag
currentFormTag
Form tag being processed right now.
protected String
formClassPattern
The pattern for the form class.

Fields inherited from class xdoclet.DocletSupport

currentClassTag, currentFieldTag, currentMethodTag

Constructor Summary

ActionFormSubTask()
Describe what the ActionFormActionFormSubTaskstructor does

Method Summary

protected void
engineStarted()
Describe what the method does
protected void
generateForClass(XClass clazz)
iterate through all struts:form tags,and produce separate classes
String
getActionFormClassPattern()
Return the class pattern.
XTag
getCurrentFormTag()
Gets the CurrentFormTag attribute of the ActionFormSubTask object
protected String
getGeneratedFileName(XClass clazz)
Gets the GeneratedFileName attribute of the ActionFormSubTask object
protected boolean
matchesGenerationRules(XClass clazz)
Returns whether struts form[s] shall be generated for this class
void
setCurrentFormTag(XTag t)
Sets the CurrentFormTag attribute of the ActionFormSubTask object
void
setPattern(String newPattern)
Sets the Pattern attribute of the ActionFormSubTask object
void
validateOptions()
Called to validate configuration parameters.

Methods inherited from class xdoclet.TemplateSubTask

addOfType, addOfType, addPackageSubstitution, copyAttributesFrom, engineFinished, engineStarted, execute, generateForClass, getAcceptAbstractClasses, getAcceptInterfaces, getDestinationFile, getEngine, getExtent, getGeneratedFileName, getGenerationManager, getHavingClassTag, getOfType, getPackageSubstitutions, getSubTaskClassName, getTemplateURL, init, isPackageSubstitutionInheritanceSupported, isPrefixWithPackageStructure, javaFile, matchesGenerationRules, processInnerClasses, setAcceptAbstractClasses, setAcceptInterfaces, setDestinationFile, setEngine, setExtent, setExtentValue, setGenerationManager, setHavingClassTag, setOfType, setPackageSubstitutionInheritanceSupported, setPackageSubstitutions, setPrefixWithPackageStructure, setSubTaskClassName, setTemplateFile, setTemplateURL, startEngine, startProcess, startProcessForAll, startProcessPerClass, validateOptions

Methods inherited from class xdoclet.SubTask

addConfigParam, copyAttributesFrom, execute, getConfigParams, getConfigParamsAsMap, getContext, getDestDir, getMergeDir, getSubTaskName, getXJavaDoc, init, setDestDir, setMergeDir, setSubTaskName, validateOptions

Methods inherited from class xdoclet.DocletSupport

getCurrentClass, getCurrentClassTag, getCurrentConstructor, getCurrentField, getCurrentFieldTag, getCurrentMethod, getCurrentMethodTag, getCurrentPackage, getCurrentTag, isDocletGenerated, popCurrentClass, pushCurrentClass, setCurrentClass, setCurrentClassTag, setCurrentConstructor, setCurrentField, setCurrentFieldTag, setCurrentMethod, setCurrentMethodTag, setCurrentPackage

Field Details

DEFAULT_TEMPLATE_FILE

protected static String DEFAULT_TEMPLATE_FILE
The default template file - struts_form.xdt.

currentFormTag

protected XTag currentFormTag
Form tag being processed right now.

formClassPattern

protected String formClassPattern
The pattern for the form class. Defaults to {0}{1}Form if not present.

Constructor Details

ActionFormSubTask

public ActionFormSubTask()
Describe what the ActionFormActionFormSubTaskstructor does

Method Details

engineStarted

protected void engineStarted()
            throws xdoclet.XDocletException
Describe what the method does
Overrides:
engineStarted in interface xdoclet.TemplateSubTask
Throws:
xdoclet.XDocletException - Describe the exception

generateForClass

protected void generateForClass(XClass clazz)
            throws xdoclet.XDocletException
iterate through all struts:form tags,and produce separate classes
Overrides:
generateForClass in interface xdoclet.TemplateSubTask
Parameters:
clazz - Description of Parameter
Throws:
xdoclet.XDocletException - Description of Exception

getActionFormClassPattern

public String getActionFormClassPattern()
Return the class pattern.
Returns:
The ActionFormClassPattern value

getCurrentFormTag

public XTag getCurrentFormTag()
Gets the CurrentFormTag attribute of the ActionFormSubTask object
Returns:
The CurrentFormTag value

getGeneratedFileName

protected String getGeneratedFileName(XClass clazz)
            throws xdoclet.XDocletException
Gets the GeneratedFileName attribute of the ActionFormSubTask object
Overrides:
getGeneratedFileName in interface xdoclet.TemplateSubTask
Parameters:
clazz - Describe what the parameter does
Returns:
The GeneratedFileName value
Throws:
xdoclet.XDocletException - Describe the exception

matchesGenerationRules

protected boolean matchesGenerationRules(XClass clazz)
            throws xdoclet.XDocletException
Returns whether struts form[s] shall be generated for this class
Overrides:
matchesGenerationRules in interface xdoclet.TemplateSubTask
Parameters:
clazz - Description of Parameter
Returns:
is form tag shall be generated
Throws:
xdoclet.XDocletException - Description of Exception

setCurrentFormTag

public void setCurrentFormTag(XTag t)
Sets the CurrentFormTag attribute of the ActionFormSubTask object
Parameters:
t - The new CurrentFormTag value

setPattern

public void setPattern(String newPattern)
Sets the Pattern attribute of the ActionFormSubTask object
Parameters:
newPattern - The new Pattern value

validateOptions

public void validateOptions()
            throws xdoclet.XDocletException
Called to validate configuration parameters.
Overrides:
validateOptions in interface xdoclet.TemplateSubTask
Throws:
xdoclet.XDocletException - Description of Exception