01: package net.xoetrope.xui.validation;
02:
03: import java.awt.Component;
04:
05: /**
06: * <p>An interface defining the method taht will be called when a validation
07: * fails. The interface can be implemented by any class and in this way error
08: * reporting or logging can be redirected to a variety of destinations.</p>
09: * <p>Copyright: Copyright (c) Xoetrope Ltd., 1998-2003<br>
10: * License: see license.txt</p>
11: * $Revision: 1.11 $
12: */
13: public interface XValidationExceptionHandler {
14: /**
15: * A method called when a validation exeption has been trapped.
16: *
17: * @param c Component being validated
18: * @param ex The exception caused
19: * @param validator The validator being used to validate.
20: * @return true to continue with error validation or false to suppress further
21: * validation.
22: */
23: public boolean handleException(Component c, Exception ex,
24: XValidator validator);
25:
26: /**
27: * informs the handler when a page validation is starting or stopping. Typically
28: * when it starts the page will begin to accumulate message which are to be displayed.
29: * When the parameter is false the page will usually display the accumulated
30: * messages
31: * @param start boolean to indicate whether the accumulation is started or stopped.
32: * @param level int which indicates the most serious level of error encountered
33: * @return the new level which might be set to zero if a confirm dialog is displayed
34: */
35: public int accumulateMessages(boolean accumulate, int level);
36: }
|