net.xoetrope.xui.exception
Interface XExceptionHandler

All Known Subinterfaces:
PageSupport
All Known Implementing Classes:
NavigationHelper, XDialog, XDialog, XMessageBox, XMessageBox, XPage, XSwtPage, XValidationHandler

public interface XExceptionHandler

An interface defining the method that will be called when a validation/service or other area of functionality fails. The interface can be implemented by any class and in this way error reporting or logging can be redirected to a variety of destinations.

Copyright: Copyright (c) Xoetrope Ltd., 1998-2005
License: see license.txt

$Revision: 1.2 $


Method Summary
 int accumulateMessages(boolean accumulate, int level)
          informs the handler when page checking is starting or stopping.
 boolean handleEventHandlerException(XProject 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.
 

Method Detail

handleException

boolean handleException(java.lang.Object c,
                        java.lang.Exception ex,
                        java.lang.Object checker)
A method called when an exeption has been trapped.

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

int accumulateMessages(boolean accumulate,
                       int level)
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

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

boolean handleEventHandlerException(XProject project,
                                    java.lang.Object container,
                                    java.lang.Throwable error)
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.

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