You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@locus.apache.org on 2000/12/26 21:49:07 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/action ActionErrors.java

craigmcc    00/12/26 12:49:06

  Modified:    src/share/org/apache/struts/action ActionErrors.java
  Log:
  Add a method that returns an Iterator over the property names for which at
  least one error message has been recorded.  Existing methods will return
  you an Iterator of the actual errors for that property, or the count of
  the number of errors for that property.
  
  Submitted by:	Elod Horvath <el...@itfais.com>
  
  Revision  Changes    Path
  1.3       +18 -4     jakarta-struts/src/share/org/apache/struts/action/ActionErrors.java
  
  Index: ActionErrors.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionErrors.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ActionErrors.java	2000/12/07 19:31:01	1.2
  +++ ActionErrors.java	2000/12/26 20:49:06	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionErrors.java,v 1.2 2000/12/07 19:31:01 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/12/07 19:31:01 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionErrors.java,v 1.3 2000/12/26 20:49:06 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/12/26 20:49:06 $
    *
    * ====================================================================
    *
  @@ -89,7 +89,7 @@
    *
    * @author David Geary
    * @author Craig R. McClanahan
  - * @revision $Revision: 1.2 $ $Date: 2000/12/07 19:31:01 $
  + * @revision $Revision: 1.3 $ $Date: 2000/12/26 20:49:06 $
    */
   
   public class ActionErrors implements Serializable {
  @@ -200,6 +200,20 @@
               return (empty.iterator());
           else
               return (list.iterator());
  +
  +    }
  +
  +
  +    /**
  +     * Return the set of property names for which at least one error has
  +     * been recorded.  If there are no errors, an empty Iterator is returned.
  +     * If you have recorded global errors, the String value of
  +     * <code>ActionErrors.GLOBAL_ERROR</code> will be one of the returned
  +     * property names.
  +     */
  +    public Iterator properties() {
  +
  +        return (errors.keySet().iterator());
   
       }