org.barracudamvc.core.forms
Class ValidationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.barracudamvc.plankton.exceptions.NestableException
              extended by org.barracudamvc.core.forms.ValidationException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DeferredValidationException, ParseException, UnableToValidateException

public class ValidationException
extends NestableException

This class defines the validation exception. Code that catches these exceptions should check for subExceptions, as this class can be used to group collections of ValidationExceptions.

See Also:
Serialized Form

Field Summary
protected static String sep
           
protected  Object source
           
protected  List subExceptions
           
 
Constructor Summary
ValidationException()
          The noargs public contructor for ValidationException
ValidationException(Object source)
          The public contructor for ValidationException
ValidationException(Object source, String s)
          The public contructor for ValidationException
ValidationException(Object isource, String s, Exception ibaseException)
          The public contructor for ValidationException
ValidationException(String s)
          The public contructor for ValidationException
 
Method Summary
 void addSubException(ValidationException ve)
          Add a sub exception
 List getExceptionList()
          Collapse all sub-exceptions into a single list of Validation exceptions
protected  List getExceptionList(ValidationException ve)
           
 Object getSource()
          Get the form element which caused this error
 List getSubExceptions()
          Get a copy of the list of sub-exceptions.
 boolean hasSubExceptions()
          See if this particular ValidationException has sub-exceptions
 String toString()
           
 
Methods inherited from class org.barracudamvc.plankton.exceptions.NestableException
getBaseException, getRootException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subExceptions

protected List subExceptions

source

protected Object source

sep

protected static final String sep
Constructor Detail

ValidationException

public ValidationException()
The noargs public contructor for ValidationException


ValidationException

public ValidationException(String s)
The public contructor for ValidationException

Parameters:
s - a String describing the exception

ValidationException

public ValidationException(Object source)
The public contructor for ValidationException

Parameters:
source - the object which caused this error (usually a FormElement)

ValidationException

public ValidationException(Object source,
                           String s)
The public contructor for ValidationException

Parameters:
source - the object which caused this error (usually a FormElement)
s - a String describing the exception

ValidationException

public ValidationException(Object isource,
                           String s,
                           Exception ibaseException)
The public contructor for ValidationException

Parameters:
isource - the object which caused this error (usually a FormElement)
s - a String describing the exception
ibaseException - the original exception to wrap within this exception
Method Detail

getSource

public Object getSource()
Get the form element which caused this error

Returns:
the form element which caused this error

hasSubExceptions

public boolean hasSubExceptions()
See if this particular ValidationException has sub-exceptions

Returns:
true if this particular ValidationException has sub-exceptions

addSubException

public void addSubException(ValidationException ve)
Add a sub exception

Parameters:
ve - a sub-exception to be added

getSubExceptions

public List getSubExceptions()
Get a copy of the list of sub-exceptions. May be null if there are no sub-exceptions.

Returns:
a copy of the list of sub-exceptions

toString

public String toString()
Overrides:
toString in class Throwable

getExceptionList

public List getExceptionList()
Collapse all sub-exceptions into a single list of Validation exceptions


getExceptionList

protected List getExceptionList(ValidationException ve)


Copyright © 2006 BarracudaMVC.org All Rights Reserved.