bill.util.persist
Class PersistValidateException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--bill.util.persist.PersistException
                    |
                    +--bill.util.persist.PersistValidateException
All Implemented Interfaces:
Serializable

public class PersistValidateException
extends PersistException

Exception class for persistence validation specific exceptions. Stores a Vector of errors that were found when validating an entity. Each element of the vector is a string detailing the error encountered.

See Also:
Serialized Form

Field Summary
protected  Vector _errors
           
 
Constructor Summary
PersistValidateException()
          Creates an empty PersistValidateException.
PersistValidateException(String message)
          Creates a PersistValidateException with the specified exception message.
PersistValidateException(Vector errors)
          Creates a PersistValidateException with the specified exception message.
 
Method Summary
 Vector getErrors()
          Getter for the Vector of validation errors.
 String getMessage()
          We are overriding the getMessage method to make sure we return a value in the case where the Vector creator was used.
 void setErrors(Vector errors)
          Setter for the Vector of validation errors.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_errors

protected Vector _errors
Constructor Detail

PersistValidateException

public PersistValidateException()
Creates an empty PersistValidateException.

PersistValidateException

public PersistValidateException(String message)
Creates a PersistValidateException with the specified exception message. The exception message string can later be retrieved by the Throwable.getMessage () method of class java.lang.Throwable.
Parameters:
message - The exception message.

PersistValidateException

public PersistValidateException(Vector errors)
Creates a PersistValidateException with the specified exception message. The exception message string can later be retrieved by the Throwable.getMessage () method of class java.lang.Throwable.
Parameters:
message - The exception message.
Method Detail

getMessage

public String getMessage()
We are overriding the getMessage method to make sure we return a value in the case where the Vector creator was used. In this case we concatenate all the error messages from the Vector together, delimited with double pipes '||'.
Overrides:
getMessage in class Throwable
Returns:
The textual version of the exception's message.

setErrors

public void setErrors(Vector errors)
Setter for the Vector of validation errors.
Parameters:
errors - The list of validation errors.

getErrors

public Vector getErrors()
Getter for the Vector of validation errors.
Returns:
The list of validation errors.