rleland     2002/10/26 23:44:01

  Modified:    src/share/org/apache/struts/validator FieldChecks.java
                        Resources.java ValidatorPlugIn.java
  Log:
  Cleanup JavaDoc.
  In Plugin close stream after use.
  
  Revision  Changes    Path
  1.2       +1 -2      
jakarta-struts/src/share/org/apache/struts/validator/FieldChecks.java
  
  Index: FieldChecks.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/validator/FieldChecks.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FieldChecks.java  18 Oct 2002 03:41:10 -0000      1.1
  +++ FieldChecks.java  27 Oct 2002 06:44:00 -0000      1.2
  @@ -135,8 +135,7 @@
   
       /**
        *  <p>
  -     *
  -     *  Checks if the field isn't null based on the values of other fields
  +     *  Checks if the field isn't null based on the values of other fields.
        *  </p>
        *
        *@param  bean     The bean validation is being performed on.
  
  
  
  1.2       +32 -7     
jakarta-struts/src/share/org/apache/struts/validator/Resources.java
  
  Index: Resources.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/validator/Resources.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Resources.java    18 Oct 2002 03:41:10 -0000      1.1
  +++ Resources.java    27 Oct 2002 06:44:00 -0000      1.2
  @@ -108,6 +108,7 @@
   
      /**
       * Retrieve <code>ValidatorResources</code> for the module.
  +    * @param application servlet context
       *
       * @deprecated In Struts 1.1b3 This method can only return the resources for the 
default
       *  module.  Use getValidatorResources(HttpServletRequest, ServletContext)
  @@ -119,6 +120,8 @@
   
     /**
      * Retrieve <code>ValidatorResources</code> for the current module.
  +   * @param application  Application Context
  +   * @param request     The ServletRequest
      */
      public static ValidatorResources getValidatorResources(ServletContext 
application,HttpServletRequest request) {
         return (ValidatorResources) 
application.getAttribute(ValidatorPlugIn.VALIDATOR_KEY +
  @@ -127,6 +130,7 @@
   
      /**
       * Retrieve <code>MessageResources</code> for the application module.
  +    * @param  application servlet context
       *
       * @deprecated This method can only return the resources for the default
       *  module.  Use getMessageResources(HttpServletRequest) to get the
  @@ -138,6 +142,7 @@
   
      /**
       * Retrieve <code>MessageResources</code> for the application module.
  +    * @param request the servlet request
      */
      public static MessageResources getMessageResources(HttpServletRequest request) {
         return (MessageResources)request.getAttribute(Action.MESSAGES_KEY);
  @@ -145,6 +150,7 @@
   
      /**
       * Get the <code>Locale</code> of the current user.
  +    * @param request servlet request
      */
      public static Locale getLocale(HttpServletRequest request) {
         Locale locale = null;
  @@ -162,6 +168,9 @@
   
      /**
       * Gets the <code>Locale</code> sensitive value based on the key passed in.
  +    * @param messages  The Message resources
  +    * @param locale    The locale
  +    * @param key key used to lookup the message
      */
      public static String getMessage(MessageResources messages, Locale locale, String 
key) {
         String message = null;
  @@ -178,6 +187,8 @@
   
      /**
       * Gets the <code>Locale</code> sensitive value based on the key passed in.
  +    * @param request servlet request
  +    * @param key the request key
      */
      public static String getMessage(HttpServletRequest request, String key) {
         MessageResources messages = getMessageResources(request);
  @@ -188,6 +199,10 @@
      /**
       * Gets the locale sensitive message based on the <code>ValidatorAction</code> 
message and the
       * <code>Field</code>'s arg objects.
  +    * @param messages  The Message resources
  +    * @param locale    The locale
  +    * @param va        The Validator Action
  +    * @param field     The Validator Field
      */
      public static String getMessage(MessageResources messages, Locale locale,
                                      ValidatorAction va, Field field) {
  @@ -201,6 +216,9 @@
      /**
       * Gets the <code>ActionError</code> based on the <code>ValidatorAction</code> 
message and the
       * <code>Field</code>'s arg objects.
  +    * @param request the servlet request
  +    * @param va Validator action
  +    * @param field the validator Field
      */
      public static ActionError getActionError(HttpServletRequest request,
                                               ValidatorAction va, Field field) {
  @@ -214,6 +232,10 @@
      /**
       * Gets the message arguments based on the current <code>ValidatorAction</code>
       * and <code>Field</code>.
  +    * @param actionName   action name
  +    * @param messages  message resources
  +    * @param locale   the locale
  +    * @param field the validator field
      */
      public static String[] getArgs(String actionName, MessageResources messages,
                                     Locale locale, Field field) {
  @@ -267,10 +289,13 @@
      /**
       * Initialize the <code>Validator</code> to perform validation.
       *
  -    * @param    key     The key that the validation rules are under
  +    * @param  key     The key that the validation rules are under
       *               (the form elements name attribute).
  -    * @param    request     The current request object.
  -    * @param    errors      The object any errors will be stored in.
  +    * @param  bean
  +    * @param  application servlet context
  +    * @param  request     The current request object.
  +    * @param  errors      The object any errors will be stored in.
  +    * @param  page
      */
      public static Validator initValidator(String key, Object bean,
                                            ServletContext application, 
HttpServletRequest request,
  
  
  
  1.10      +8 -6      
jakarta-struts/src/share/org/apache/struts/validator/ValidatorPlugIn.java
  
  Index: ValidatorPlugIn.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/validator/ValidatorPlugIn.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ValidatorPlugIn.java      17 Oct 2002 03:32:29 -0000      1.9
  +++ ValidatorPlugIn.java      27 Oct 2002 06:44:00 -0000      1.10
  @@ -191,8 +191,8 @@
       /**
        * Initialize the validator resources for this module.
        *
  -     * @exception IOException if an input/output error is encountered
  -     * @exception ServletException if we cannot initialize these resources
  +     * @exception IOException if an input/output error is encountered, not thrown 
by this implementation
  +     * @exception ServletException if we cannot initialize these resources, not 
thrown by this implementation
        */
       protected void initResources() throws IOException, ServletException {
           resources = new ValidatorResources();
  @@ -220,8 +220,10 @@
                           // pass in false so resources aren't processed
                           // until last file is loaded
                           ValidatorResourcesInitializer.initialize(resources, bis, 
false);
  +                        bis.close();
                       } catch (Exception e) {
                           log.error(e.getMessage(), e);
  +                        bis.close();
                       }
                   } else {
                       log.error("Skipping validation rules file from '" + 
validatorRules + "'.  No stream could be opened.");
  
  
  

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

Reply via email to