org.formaria.swing.validation
Class ValidationExceptionHandler

java.lang.Object
  extended by org.formaria.swing.validation.ValidationExceptionHandler
All Implemented Interfaces:
ExceptionHandler

public class ValidationExceptionHandler
extends java.lang.Object
implements ExceptionHandler

An exception handler that allows messages to be redirected to a common log or console.


Method Summary
 int accumulateMessages(boolean accumulate, int level)
          informs the handler when page checking is starting or stopping.
static ValidationExceptionHandler getInstance()
           
 boolean handleEventHandlerException(Project project, java.lang.Object container, java.lang.Throwable error)
          Handle an exception during the invocation of a page's event handler.
 boolean handleException(java.lang.Object c, java.lang.Exception ex, java.lang.Object checker)
          A method called when an exeption has been trapped.
 void setErrorList(List errorList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ValidationExceptionHandler getInstance()

setErrorList

public void setErrorList(List errorList)

handleException

public boolean handleException(java.lang.Object c,
                               java.lang.Exception ex,
                               java.lang.Object checker)
Description copied from interface: ExceptionHandler
A method called when an exeption has been trapped.

Specified by:
handleException in interface ExceptionHandler
Parameters:
c - Component being validated
ex - The exception caused
checker - The object being used to check validity and throw exceptions.
Returns:
true to continue with error checking or false to suppress further checking.

accumulateMessages

public int accumulateMessages(boolean accumulate,
                              int level)
Description copied from interface: ExceptionHandler
informs the handler when page checking is starting or stopping. Typically when it starts the page will begin to accumulate message which are to be displayed. When the parameter is false the page will usually display the accumulated messages

Specified by:
accumulateMessages in interface ExceptionHandler
Parameters:
accumulate - boolean to indicate whether the accumulation is started or stopped.
level - int which indicates the most serious level of error encountered
Returns:
the new level which might be set to zero if a confirm dialog is displayed

handleEventHandlerException

public boolean handleEventHandlerException(Project project,
                                           java.lang.Object container,
                                           java.lang.Throwable error)
Description copied from interface: ExceptionHandler
Handle an exception during the invocation of a page's event handler. The page normally implements this interface and has the first chance at handling the error. Thereafter if false is returned a central (optional) exception handler owned by the project is invoked.

Specified by:
handleEventHandlerException in interface ExceptionHandler
Parameters:
project - the current project
container - the page
error - the exception or error that was thrown
Returns:
true to continue processing, false to stop processing