org.makumba
Class CompositeValidationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.makumba.CompositeValidationException
All Implemented Interfaces:
Serializable

public class CompositeValidationException
extends RuntimeException

This class holds several InvalidValueException of the same form together.

Version:
$Id: CompositeValidationException.java 5154 2010-05-18 22:01:40Z rosso_nero $
Author:
Rudolf Mayer
See Also:
Serialized Form

Constructor Summary
CompositeValidationException()
          Creates an empty instance
CompositeValidationException(InvalidValueException... exceptions)
          Creates an instance and adds all exceptions from the given array
CompositeValidationException(Iterable<InvalidValueException> exceptions)
          Creates an instance and adds all exceptions from the given Iterable
 
Method Summary
 void addException(InvalidValueException e)
          Adds a new exception
 ArrayList<InvalidValueException> getExceptions()
           
 Collection<InvalidValueException> getExceptions(String fieldName)
          Gets the exceptions gathered for a specific field name
 String getMessage()
          returns the value of toString()
 boolean throwCheck()
          Checks whether there are any exceptions gathered, and if so throws this CompositeValidationException
 String toString()
          Prints the messages of all exceptions gathered
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeValidationException

public CompositeValidationException()
Creates an empty instance


CompositeValidationException

public CompositeValidationException(Iterable<InvalidValueException> exceptions)
Creates an instance and adds all exceptions from the given Iterable


CompositeValidationException

public CompositeValidationException(InvalidValueException... exceptions)
Creates an instance and adds all exceptions from the given array

Method Detail

getExceptions

public ArrayList<InvalidValueException> getExceptions()

addException

public void addException(InvalidValueException e)
Adds a new exception


throwCheck

public boolean throwCheck()
                   throws CompositeValidationException
Checks whether there are any exceptions gathered, and if so throws this CompositeValidationException

Throws:
CompositeValidationException

toString

public String toString()
Prints the messages of all exceptions gathered

Overrides:
toString in class Throwable

getMessage

public String getMessage()
returns the value of toString()

Overrides:
getMessage in class Throwable

getExceptions

public Collection<InvalidValueException> getExceptions(String fieldName)
Gets the exceptions gathered for a specific field name