au.gov.tas.dpiwe.mr.bean
Class ValidateFieldsException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by javax.ejb.EJBException
                  extended by au.gov.tas.dpiwe.mr.bean.ValidateFieldsException
All Implemented Interfaces:
Iterable, Serializable

public class ValidateFieldsException
extends EJBException
implements Iterable

ValidateFields exception is thrown when a bean fails one or more validation tests.

Since:
Mr Architecture 2.2
Version:
1.0.0.2
Author:
Malcolm Robinson, Kade Hansson
See Also:
Serialized Form

Field Summary
protected  Collection exceptions
          The Exceptions which were encountered during the validation process.
 
Constructor Summary
ValidateFieldsException()
          A validate fields exception encompassing many ValidateExceptions, which are added as if this were a collection.
ValidateFieldsException(ValidateException validateException)
          Constructs a new validate fields exception with a single ValidateException.
 
Method Summary
 void add(ValidateException validateException)
          Adds a ValidateException to this collection.
 String getMessage()
          Returns an error message for the first of the wrapped exceptions.
 boolean hasException()
          Returns true if this collection contains at least one ValidateException.
 Iterator iterator()
          Returns an iterator over the components of this composite object.
 
Methods inherited from class javax.ejb.EJBException
getCausedByException, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

exceptions

protected Collection exceptions
The Exceptions which were encountered during the validation process.

Constructor Detail

ValidateFieldsException

public ValidateFieldsException()
A validate fields exception encompassing many ValidateExceptions, which are added as if this were a collection.


ValidateFieldsException

public ValidateFieldsException(ValidateException validateException)
Constructs a new validate fields exception with a single ValidateException.

Parameters:
validateException - the single ValidateException.
Method Detail

add

public void add(ValidateException validateException)
Adds a ValidateException to this collection.

Parameters:
validateException - the ValidateException to add.

getMessage

public String getMessage()
Returns an error message for the first of the wrapped exceptions.

Overrides:
getMessage in class EJBException
Returns:
an error message for one of the wrapped exceptions.

hasException

public boolean hasException()
Returns true if this collection contains at least one ValidateException.

Returns:
true if this collection contains at least one ValidateException, false if it contains none.

iterator

public Iterator iterator()
Description copied from interface: Iterable
Returns an iterator over the components of this composite object.

Specified by:
iterator in interface Iterable
Returns:
an iterator over the components of this composite object.