commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/latka/src/java/org/apache/commons/latka ValidationException.java
Date Sat, 02 Feb 2002 12:25:38 GMT
dion        02/02/02 04:25:38

  Modified:    latka/src/java/org/apache/commons/latka
                        ValidationException.java
  Log:
  Formatting, javadocs etc
  
  Revision  Changes    Path
  1.6       +29 -6     jakarta-commons/latka/src/java/org/apache/commons/latka/ValidationException.java
  
  Index: ValidationException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/ValidationException.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ValidationException.java	4 Sep 2001 05:37:13 -0000	1.5
  +++ ValidationException.java	2 Feb 2002 12:25:38 -0000	1.6
  @@ -60,15 +60,27 @@
   package org.apache.commons.latka;
   
   /**
  - * Needs docs
  + * This exception is thrown by <em>validators</em> when a validation has failed
    *
    * @author Doug Sale
  + * @author dIon Gillard (mainly javadoc)
  + * @version $Revision: 1.6 $
    */
   public class ValidationException extends Exception {
  +    
  +    /**
  +     * Create a validation exception with a null label and reason
  +     */
       public ValidationException() {
           this(null,null);
       }
   
  +    /**
  +     * Create a validation exception with the given
  +     * label and reason
  +     * @param label the user's description of the assertion/test
  +     * @param reason the reason it failed
  +     */    
       public ValidationException(String label, String reason) {
           _label = label;
           _reason = reason;
  @@ -80,26 +92,37 @@
       /** Why the test/assertion failed */
       private String _reason = null;
   
  +    /**
  +     * the message of the exception
  +     * @return the message of the exception, built from
  +     * the label and reason
  +     */    
       public String getMessage() {
           StringBuffer buf = new StringBuffer();
  -        if(null != getLabel()) {
  +        if (null != getLabel()) {
               buf.append(getLabel());
  -            if(null != getReason()) {
  +            if (null != getReason()) {
                   buf.append(": ");
               }
           }
  -        if(null != getReason()) {
  +        if (null != getReason()) {
               buf.append(getReason());
           }
           return buf.toString();
       }
   
  -    /** User's description of the test/assertion */
  +    /**
  +     * User's description of the test/assertion
  +     * @return User's description of the test/assertion
  +     */
       public String getLabel() {
           return _label;
       }
   
  -    /** Why the test/assertion failed */
  +    /**
  +     * Why the test/assertion failed
  +     * @return Why the test/assertion failed
  +     */
       public String getReason() {
           return _reason;
       }
  
  
  

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


Mime
View raw message