| 1088 | | public interface ComponentErrorHandler { |
| 1089 | | /** |
| 1090 | | * Handle the component error |
| 1091 | | * |
| 1092 | | * @param event |
| 1093 | | * @return True if the error has been handled False, otherwise |
| 1094 | | */ |
| 1095 | | public boolean handleComponentError(ComponentErrorEvent event); |
| 1096 | | } |
| 1097 | | |
| 1098 | | /** |
| 1099 | | * Gets the error handler for the component. |
| 1100 | | * |
| 1101 | | * The error handler is dispatched whenever there is an error processing the |
| 1102 | | * data coming from the client. |
| 1103 | | * |
| 1104 | | * @return |
| 1105 | | */ |
| 1106 | | public ComponentErrorHandler getErrorHandler() { |
| 1107 | | return errorHandler; |
| 1108 | | } |
| 1109 | | |
| 1110 | | /** |
| 1111 | | * Sets the error handler for the component. |
| 1112 | | * |
| 1113 | | * The error handler is dispatched whenever there is an error processing the |
| 1114 | | * data coming from the client. |
| 1115 | | * |
| 1116 | | * If the error handler is not set, the application error handler is used to |
| 1117 | | * handle the exception. |
| 1118 | | * |
| 1119 | | * @param errorHandler |
| 1120 | | * AbstractField specific error handler |
| 1121 | | */ |
| 1122 | | public void setErrorHandler(ComponentErrorHandler errorHandler) { |
| 1123 | | this.errorHandler = errorHandler; |
| 1124 | | } |
| 1125 | | |
| 1126 | | public boolean handleError(ComponentErrorEvent error) { |
| 1127 | | if (errorHandler != null) { |
| 1128 | | return errorHandler.handleComponentError(error); |
| 1129 | | } |
| 1130 | | return false; |
| 1131 | | |
| 1132 | | } |
| 1133 | | |