User: rinkrank
  Date: 02/05/30 11:38:57

  Modified:    modules/apache/src/xdoclet/modules/apache/struts
                        StrutsConfigXmlSubTask.java
                        StrutsFormTagsHandler.java
  Log:
  Refactoring which removes redundant subtask names (both in @xdoclet.subtask 
name="blabla" and in code)
  -Removed the static SUBTASK_NAME and overridden getSubTaskName() from all SubTasks 
(it's final now in SubTask)
  -DocletTask stores all subtask names in a Class->String Map, using the name from 
xdoclet.xml (which in turn comes from @xdoclet.subtask name="blabla"
  -All references to SomeSubTask.SUBTASK_NAME replaced by a call to 
DocletTask.getSubTaskName(Class subTaskClass)
  -Improved error reporting in DocletTask
  -Reverted the ejbjarxml/webxml to deploymentdescriptor
  -Added omit.docs flag in xdoclet/build.xml set it to true in ANT_OPTS for faster 
build
  
  Revision  Changes    Path
  1.3       +1 -13     
xdoclet/modules/apache/src/xdoclet/modules/apache/struts/StrutsConfigXmlSubTask.java
  
  Index: StrutsConfigXmlSubTask.java
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/apache/src/xdoclet/modules/apache/struts/StrutsConfigXmlSubTask.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -w -r1.2 -r1.3
  --- StrutsConfigXmlSubTask.java       28 May 2002 22:35:22 -0000      1.2
  +++ StrutsConfigXmlSubTask.java       30 May 2002 18:38:57 -0000      1.3
  @@ -15,12 +15,10 @@
    * @author            Dmitri Colebatch ([EMAIL PROTECTED])
    * @created           September 2, 2001
    * @xdoclet:subtask   display-name="struts-config.xml" name="strutsconfigxml" 
parent="xdoclet.modules.web.WebDocletTask"
  - * @version           $Revision: 1.2 $
  + * @version           $Revision: 1.3 $
    */
   public class StrutsConfigXmlSubTask extends XmlSubTask
   {
  -    public final static String SUBTASK_NAME = "strutsConfigXml";
  -
       private final static String STRUTS_PUBLICID_10 = "-//Apache Software 
Foundation//DTD Struts Configuration 1.0//EN";
   
       private final static String STRUTS_SYSTEMID_10 = 
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";;
  @@ -49,16 +47,6 @@
       {
           setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
           setDestinationFile(GENERATED_FILE_NAME);
  -    }
  -
  -    /**
  -     * Gets the SubTaskName attribute of the StrutsConfigXmlSubTask object
  -     *
  -     * @return   The SubTaskName value
  -     */
  -    public String getSubTaskName()
  -    {
  -        return SUBTASK_NAME;
       }
   
       /**
  
  
  
  1.3       +8 -7      
xdoclet/modules/apache/src/xdoclet/modules/apache/struts/StrutsFormTagsHandler.java
  
  Index: StrutsFormTagsHandler.java
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/apache/src/xdoclet/modules/apache/struts/StrutsFormTagsHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -w -r1.2 -r1.3
  --- StrutsFormTagsHandler.java        28 May 2002 22:35:22 -0000      1.2
  +++ StrutsFormTagsHandler.java        30 May 2002 18:38:57 -0000      1.3
  @@ -19,8 +19,9 @@
   import xjavadoc.XMethod;
   import xjavadoc.XTag;
   import xdoclet.DocletContext;
  -import xdoclet.XDocletException;
   
  +import xdoclet.DocletTask;
  +import xdoclet.XDocletException;
   import xdoclet.XDocletTagSupport;
   import xdoclet.modules.apache.struts.ejb.StrutsFormSubTask;
   import xdoclet.modules.ejb.EjbTagsHandler;
  @@ -33,7 +34,7 @@
    * @author               Dmitri Colebatch ([EMAIL PROTECTED])
    * @created              Oct 19, 2001
    * @xdoclet:taghandler   namespace="StrutsForm"
  - * @version              $Revision: 1.2 $
  + * @version              $Revision: 1.3 $
    */
   public class StrutsFormTagsHandler extends EjbTagsHandler
   {
  @@ -48,7 +49,7 @@
       {
           String packageName = clazz.getContainingPackage().getName();
   
  -        packageName = choosePackage(packageName, null, 
StrutsFormSubTask.SUBTASK_NAME);
  +        packageName = choosePackage(packageName, null, 
DocletTask.getSubTaskName(StrutsFormSubTask.class));
           return packageName + '.' + getStrutsFormClassName(clazz);
       }
   
  @@ -61,7 +62,7 @@
        */
       public static String getStrutsFormClassName(XClass clazz) throws 
XDocletException
       {
  -        XTag currentTag = ((StrutsFormSubTask) 
DocletContext.getInstance().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getCurrentFormTag();
  +        XTag currentTag = ((StrutsFormSubTask) 
DocletContext.getInstance().getSubTaskBy(DocletTask.getSubTaskName(StrutsFormSubTask.class))).getCurrentFormTag();
   
           // check if there is a name parameter
           String name = currentTag.getAttributeValue("name");
  @@ -93,7 +94,7 @@
        */
       protected static String getStrutsFormClassPattern()
       {
  -        return ((StrutsFormSubTask) 
DocletContext.getInstance().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getStrutsFormClassPattern();
  +        return ((StrutsFormSubTask) 
DocletContext.getInstance().getSubTaskBy(DocletTask.getSubTaskName(StrutsFormSubTask.class))).getStrutsFormClassPattern();
       }
   
       /**
  @@ -113,7 +114,7 @@
        */
       public String strutsFormName() throws XDocletException
       {
  -        XTag currentTag = ((StrutsFormSubTask) 
getDocletContext().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getCurrentFormTag();
  +        XTag currentTag = ((StrutsFormSubTask) 
getDocletContext().getSubTaskBy(DocletTask.getSubTaskName(StrutsFormSubTask.class))).getCurrentFormTag();
           String formName = currentTag.getAttributeValue("name");
   
           if (formName == null || formName.trim().length() == 0) {
  @@ -196,7 +197,7 @@
       protected boolean useMethodInForm(XMethod method) throws XDocletException
       {
           // check for include-all
  -        XTag currentTag = ((StrutsFormSubTask) 
getDocletContext().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getCurrentFormTag();
  +        XTag currentTag = ((StrutsFormSubTask) 
getDocletContext().getSubTaskBy(DocletTask.getSubTaskName(StrutsFormSubTask.class))).getCurrentFormTag();
           String value = currentTag.getAttributeValue("include-all");
   
           // by default, include all is true
  
  
  

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to