User: pathoss 
  Date: 02/05/15 15:06:15

  Modified:    modules/apache/src/xdoclet/modules/apache/struts Tag:
                        MODULE_REFACTORING_BRANCH
                        StrutsFormTagsHandler.java
  Log:
  Cleanup.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.7   +212 -207  
xdoclet/modules/apache/src/xdoclet/modules/apache/struts/Attic/StrutsFormTagsHandler.java
  
  Index: StrutsFormTagsHandler.java
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/apache/src/xdoclet/modules/apache/struts/Attic/StrutsFormTagsHandler.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -w -r1.1.2.6 -r1.1.2.7
  --- StrutsFormTagsHandler.java        15 May 2002 19:10:39 -0000      1.1.2.6
  +++ StrutsFormTagsHandler.java        15 May 2002 22:06:15 -0000      1.1.2.7
  @@ -4,45 +4,106 @@
    */
   package xdoclet.modules.apache.struts;
   
  -import java.text.MessageFormat;
   import java.beans.Introspector;
   
  -import java.util.Map;
  -import java.util.HashMap;
  -import java.util.Properties;
  +import java.text.MessageFormat;
   import java.util.ArrayList;
  +import java.util.HashMap;
   
  -import xdoclet.XDocletTagSupport;
  -import xdoclet.DocletContext;
  -import xdoclet.XDocletException;
  -import xdoclet.modules.apache.struts.ejb.StrutsFormSubTask;
  +import java.util.Map;
  +import java.util.Properties;
   
  -import xdoclet.tagshandler.MethodTagsHandler;
  +import org.apache.commons.logging.Log;
   
   import xjavadoc.XClass;
   import xjavadoc.XMethod;
   import xjavadoc.XTag;
  +import xdoclet.DocletContext;
  +import xdoclet.XDocletException;
   
  -import org.apache.commons.logging.Log;
  -import xdoclet.util.LogUtil;
  +import xdoclet.XDocletTagSupport;
  +import xdoclet.modules.apache.struts.ejb.StrutsFormSubTask;
   import xdoclet.modules.ejb.EjbTagsHandler;
   import xdoclet.modules.ejb.entity.PersistentTagsHandler;
   
  +import xdoclet.tagshandler.MethodTagsHandler;
  +import xdoclet.util.LogUtil;
  +
   /**
  - * @xdoclet:taghandler namespace="StrutsForm"
  - *
    * @author Dmitri Colebatch ([EMAIL PROTECTED])
    * @created Oct 19, 2001
  - * @version $Revision: 1.1.2.6 $
  + * @xdoclet:taghandler   namespace="StrutsForm"
  + * @version              $Revision: 1.1.2.7 $
  + */
  +public class StrutsFormTagsHandler extends EjbTagsHandler
  +{
  +    /**
  +     * Gets the StrutsFormClassFor attribute of the StrutsFormTagsHandler class.
  +     *
  +     * @param clazz                 Describe what the parameter does
  +     * @return                      The StrutsFormClassFor value
  +     * @exception XDocletException  Describe the exception
  +     */
  +    public static String getStrutsFormClassFor(XClass clazz) throws XDocletException
  +    {
  +        String packageName = clazz.containingPackage().name();
  +
  +        packageName = choosePackage(packageName, null, 
StrutsFormSubTask.SUBTASK_NAME);
  +        return packageName + '.' + getStrutsFormClassName(clazz);
  +    }
  +
  +    /**
  +     * Gets the StrutsFormClassName attribute of the StrutsFormTagsHandler class
  +     *
  +     * @param clazz                 Describe what the parameter does
  +     * @return                      The StrutsFormClassName value
  +     * @exception XDocletException  Describe the exception
  +     */
  +    public static String getStrutsFormClassName(XClass clazz) throws 
XDocletException
  +    {
  +        XTag currentTag = ((StrutsFormSubTask) 
DocletContext.getInstance().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getCurrentFormTag();
  +
  +        // check if there is a name parameter
  +        String name = currentTag.attributeValue("name");
  +
  +        if (name == null) {
  +            return getShortEjbNameFor(clazz) + "Form";
  +        }
  +        else {
  +            return MessageFormat.format(getStrutsFormClassPattern(), new 
Object[]{getShortEjbNameFor(clazz), name});
  +        }
  +    }
  +
  +    /**
  +     * Return true if at least one struts:form tag is defined.
  +     *
  +     * @param clazz                 Class to check
  +     * @return                      whether class has struts:form tag defined
  +     * @exception XDocletException  Description of Exception
  +     */
  +    public static boolean hasFormDefinition(XClass clazz) throws XDocletException
  +    {
  +        return clazz.doc().hasTag("struts:form", false);
  +    }
  +
  +    /**
  +     * Gets the StrutsFormClassPattern attribute of the StrutsFormTagsHandler class
  +     *
  +     * @return   The StrutsFormClassPattern value
    */
  -public class StrutsFormTagsHandler extends EjbTagsHandler {
  +    protected static String getStrutsFormClassPattern()
  +    {
  +        return ((StrutsFormSubTask) 
DocletContext.getInstance().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getStrutsFormClassPattern();
  +    }
  +
        /**
         * Return the class name for the current class.
         *
         * @return Description of the Returned Value
         * @exception XDocletException Description of Exception
         */
  -     public String strutsFormClass() throws XDocletException {
  +    public String strutsFormClass() throws XDocletException
  +    {
                return getStrutsFormClassFor(getCurrentClass());
        }
   
  @@ -50,7 +111,8 @@
         * @return Description of the Returned Value
         * @exception XDocletException Description of Exception
         */
  -     public String strutsFormName() throws XDocletException {
  +    public String strutsFormName() throws XDocletException
  +    {
                XTag currentTag = 
((StrutsFormSubTask)getDocletContext().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getCurrentFormTag();
                String formName = currentTag.attributeValue("name");
   
  @@ -69,7 +131,8 @@
         * @exception XDocletException Description of Exception
         * @doc:tag type="block"
         */
  -     public void forAllFormFields(String template) throws XDocletException {
  +    public void forAllFormFields(String template) throws XDocletException
  +    {
                // all fields carrying @struts:form-field form-name="<bla>" where 
<bla> is current
                // form name, or all persistent fields if  include-all="true" is set
                // pk fields are included implicitly, unless include-pk="false" is 
specified.
  @@ -123,14 +186,15 @@
        }
   
        /**
  -      * Check that method has struts:form-field tag with valid name, or is pk field
  -      * (and pk fields are included) or include-all="true".
  +     * Check that method has struts:form-field tag with valid name, or is pk field 
(and pk fields are included) or
  +     * include-all="true".
         *
         * @param method Description of Parameter
         * @return Description of the Returned Value
         * @exception XDocletException Description of Exception
         */
  -     protected boolean useMethodInForm(XMethod method) throws XDocletException {
  +    protected boolean useMethodInForm(XMethod method) throws XDocletException
  +    {
                // check for include-all
                XTag currentTag = 
((StrutsFormSubTask)getDocletContext().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getCurrentFormTag();
                String value = currentTag.attributeValue("include-all");
  @@ -166,63 +230,4 @@
                // no need in such field...
                return false;
        }
  -
  -     /**
  -      * Gets the StrutsFormClassFor attribute of the StrutsFormTagsHandler class.
  -      *
  -      * @param clazz Describe what the parameter does
  -      * @return The StrutsFormClassFor value
  -      * @exception XDocletException Describe the exception
  -      * @todo-javadoc Write javadocs for method parameter
  -      * @todo-javadoc Write javadocs for exception
  -      */
  -     public static String getStrutsFormClassFor(XClass clazz) throws 
XDocletException {
  -             String packageName = clazz.containingPackage().name();
  -
  -             packageName = choosePackage(packageName, null, 
StrutsFormSubTask.SUBTASK_NAME);
  -             return packageName + '.' + getStrutsFormClassName(clazz);
  -     }
  -
  -     /**
  -      * Gets the StrutsFormClassName attribute of the StrutsFormTagsHandler class
  -      *
  -      * @param clazz Describe what the parameter does
  -      * @return The StrutsFormClassName value
  -      * @exception XDocletException Describe the exception
  -      * @todo-javadoc Write javadocs for method parameter
  -      * @todo-javadoc Write javadocs for exception
  -      */
  -     public static String getStrutsFormClassName(XClass clazz) throws 
XDocletException {
  -             XTag currentTag = 
((StrutsFormSubTask)DocletContext.getInstance().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getCurrentFormTag();
  -
  -             // check if there is a name parameter
  -             String name = currentTag.attributeValue("name");
  -
  -             if (name == null) {
  -                     return getShortEjbNameFor(clazz) + "Form";
  -             }
  -             else {
  -                     return MessageFormat.format(getStrutsFormClassPattern(), new 
Object[]{getShortEjbNameFor(clazz), name});
  -             }
  -     }
  -
  -     /**
  -      * Return true if at least one struts:form tag is defined.
  -      *
  -      * @param clazz Class to check
  -      * @return whether class has struts:form tag defined
  -      * @exception XDocletException Description of Exception
  -      */
  -     public static boolean hasFormDefinition(XClass clazz) throws XDocletException {
  -             return clazz.doc().hasTag("struts:form", false);
  -     }
  -
  -     /**
  -      * Gets the StrutsFormClassPattern attribute of the StrutsFormTagsHandler class
  -      *
  -      * @return The StrutsFormClassPattern value
  -      */
  -     protected static String getStrutsFormClassPattern() {
  -             return 
((StrutsFormSubTask)DocletContext.getInstance().getSubTaskBy(StrutsFormSubTask.SUBTASK_NAME)).getStrutsFormClassPattern();
  -     }
   }
  
  
  

_______________________________________________________________

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

Reply via email to