User: pathoss
Date: 02/05/12 08:34:57
Modified: modules/apache/src/xdoclet/modules/apache/struts/ejb Tag:
MODULE_REFACTORING_BRANCH StrutsFormSubTask.java
Log:
Coding conventions.
Revision Changes Path
No revision
No revision
1.1.2.8 +183 -175
xdoclet/modules/apache/src/xdoclet/modules/apache/struts/ejb/Attic/StrutsFormSubTask.java
Index: StrutsFormSubTask.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/apache/src/xdoclet/modules/apache/struts/ejb/Attic/StrutsFormSubTask.java,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -w -r1.1.2.7 -r1.1.2.8
--- StrutsFormSubTask.java 12 May 2002 15:21:15 -0000 1.1.2.7
+++ StrutsFormSubTask.java 12 May 2002 15:34:57 -0000 1.1.2.8
@@ -6,34 +6,39 @@
import java.io.File;
+import org.apache.commons.logging.Log;
+
+import xjavadoc.XClass;
+import xjavadoc.XTag;
+
import xdoclet.TemplateSubTask;
import xdoclet.XDocletException;
import xdoclet.XDocletTagSupport;
import xdoclet.modules.apache.struts.StrutsFormTagsHandler;
+import xdoclet.modules.ejb.AbstractEjbCodeGeneratorSubTask;
import xdoclet.tagshandler.PackageTagsHandler;
import xdoclet.util.Translator;
-import xjavadoc.XClass;
-import xjavadoc.XTag;
-
-import org.apache.commons.logging.Log;
-import xdoclet.modules.ejb.AbstractEjbCodeGeneratorSubTask;
-
/**
- * Creates a <a href="http://jakarta.apache.org/struts">Struts</a> <a
- *
href="http://jakarta.apache.org/struts/api/org/apache/struts/action/ActionForm.html">
+ * Creates a <a href="http://jakarta.apache.org/struts">Struts</a> <a
href="http://jakarta.apache.org/struts/api/org/apache/struts/action/ActionForm.html">
* ActionForm</a> based on an entity EJB.
*
- * @xdoclet:subtask name="strutsform" parent="xdoclet.modules.ejb.EjbDocletTask"
- *
* @author Dmitri Colebatch ([EMAIL PROTECTED])
* @created September 3, 2001
- * @version $Revision: 1.1.2.7 $
+ * @xdoclet:subtask name="strutsform" parent="xdoclet.modules.ejb.EjbDocletTask"
+ * @version $Revision: 1.1.2.8 $
*/
-public class StrutsFormSubTask extends AbstractEjbCodeGeneratorSubTask {
+public class StrutsFormSubTask extends AbstractEjbCodeGeneratorSubTask
+{
+
+ public final static String SUBTASK_NAME = "strutsForm";
/**
+ * The default template file - struts_form.xdt.
+ */
+ protected static String DEFAULT_TEMPLATE_FILE = "resources/struts_form.xdt";
+ /**
* The pattern for the form class. Defaults to {0}{1}Form if not present.
*/
protected String formClassPattern;
@@ -43,48 +48,25 @@
*/
protected XTag currentFormTag;
- public final static String SUBTASK_NAME = "strutsForm";
-
- /**
- * The default template file - struts_form.j.
- */
- protected static String DEFAULT_TEMPLATE_FILE = "resources/struts_form.xdt";
-
/**
* Describe what the StrutsFormSubTask constructor does
*
* @todo-javadoc Write javadocs for constructor
*/
- public StrutsFormSubTask() {
+ public StrutsFormSubTask()
+ {
setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
setDestinationFile(getStrutsFormClassPattern() + ".java");
setOfType("javax.ejb.EntityBean");
}
/**
- * Sets the CurrentFormTag attribute of the StrutsFormSubTask object
- *
- * @param t The new CurrentFormTag value
- */
- public void setCurrentFormTag(XTag t) {
- this.currentFormTag = t;
- }
-
- /**
- * Sets the Pattern attribute of the StrutsFormSubTask object
- *
- * @param new_pattern The new Pattern value
- */
- public void setPattern(String new_pattern) {
- formClassPattern = new_pattern;
- }
-
- /**
* Gets the CurrentFormTag attribute of the StrutsFormSubTask object
*
* @return The CurrentFormTag value
*/
- public XTag getCurrentFormTag() {
+ public XTag getCurrentFormTag()
+ {
return currentFormTag;
}
@@ -93,7 +75,8 @@
*
* @return The SubTaskName value
*/
- public String getSubTaskName() {
+ public String getSubTaskName()
+ {
return SUBTASK_NAME;
}
@@ -102,7 +85,8 @@
*
* @return The StrutsFormClassPattern value
*/
- public String getStrutsFormClassPattern() {
+ public String getStrutsFormClassPattern()
+ {
if (formClassPattern != null) {
return formClassPattern;
}
@@ -112,11 +96,32 @@
}
/**
+ * Sets the CurrentFormTag attribute of the StrutsFormSubTask object
+ *
+ * @param t The new CurrentFormTag value
+ */
+ public void setCurrentFormTag(XTag t)
+ {
+ this.currentFormTag = t;
+ }
+
+ /**
+ * Sets the Pattern attribute of the StrutsFormSubTask object
+ *
+ * @param newPattern The new Pattern value
+ */
+ public void setPattern(String newPattern)
+ {
+ formClassPattern = newPattern;
+ }
+
+ /**
* Called to validate configuration parameters.
*
* @exception XDocletException Description of Exception
*/
- public void validateOptions() throws XDocletException {
+ public void validateOptions() throws XDocletException
+ {
super.validateOptions();
if (getStrutsFormClassPattern() == null ||
getStrutsFormClassPattern().trim().equals("")) {
@@ -140,7 +145,8 @@
* @todo-javadoc Write javadocs for method parameter
* @todo-javadoc Write javadocs for exception
*/
- protected String getGeneratedFileName(XClass clazz) throws XDocletException {
+ protected String getGeneratedFileName(XClass clazz) throws XDocletException
+ {
return
PackageTagsHandler.packageNameAsPathFor(StrutsFormTagsHandler.getStrutsFormClassFor(getCurrentClass()))
+ ".java";
}
@@ -151,13 +157,13 @@
* @return is form tag shall be generated
* @exception XDocletException Description of Exception
*/
- protected boolean matchesGenerationRules(XClass clazz) throws XDocletException
{
+ protected boolean matchesGenerationRules(XClass clazz) throws XDocletException
+ {
if (super.matchesGenerationRules(clazz) == false) {
return false;
}
- if (StrutsFormTagsHandler.hasFormDefinition(getCurrentClass())
- ) {
+ if (StrutsFormTagsHandler.hasFormDefinition(getCurrentClass())) {
return true;
}
else {
@@ -172,7 +178,8 @@
* @exception XDocletException Description of Exception
* @struts:form tags,and produce separate classes
*/
- protected void generateForClass(XClass clazz) throws XDocletException {
+ protected void generateForClass(XClass clazz) throws XDocletException
+ {
XTag[] formTags = clazz.doc().tags("struts:form");
int i;
@@ -191,7 +198,8 @@
* @todo-javadoc Write javadocs for method
* @todo-javadoc Write javadocs for exception
*/
- protected void engineStarted() throws XDocletException {
+ protected void engineStarted() throws XDocletException
+ {
System.out.println(Translator.getString("xdoclet.modules.apache.struts.ejb.Messages",
"generating_file",
new
String[]{StrutsFormTagsHandler.getStrutsFormClassName(getCurrentClass())}));
}
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel