| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Event |
|
| 1.0;1 |
| 1 | // Copyright 2007, 2008 The Apache Software Foundation | |
| 2 | // | |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | // you may not use this file except in compliance with the License. | |
| 5 | // You may obtain a copy of the License at | |
| 6 | // | |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | // | |
| 9 | // Unless required by applicable law or agreed to in writing, software | |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | // See the License for the specific language governing permissions and | |
| 13 | // limitations under the License. | |
| 14 | ||
| 15 | package org.apache.tapestry5.runtime; | |
| 16 | ||
| 17 | /** | |
| 18 | * The core methods related to event handling. Events used in this way exist to gather data from user code, by invoking | |
| 19 | * user methods and capturing the response. Return values from methods, if non-null, are passed to a {@link | |
| 20 | * org.apache.tapestry5.ComponentEventCallback}. The {@link ComponentEvent} subinterface extends this by providing | |
| 21 | * access to a context, or set of information related to the event, along with additional data used, at runtime, to | |
| 22 | * match events to user code methods. | |
| 23 | */ | |
| 24 | public interface Event | |
| 25 | { | |
| 26 | /** | |
| 27 | * Returns true if the event has been aborted (meaning that the return value from some event handler method was | |
| 28 | * accepted, and processing of the event was terminated). | |
| 29 | * | |
| 30 | * @return true if no further event handler methods should be invoked | |
| 31 | */ | |
| 32 | boolean isAborted(); | |
| 33 | ||
| 34 | /** | |
| 35 | * Invoke to identify, to the event, what component and method is being acted upon (used for some kinds of exception | |
| 36 | * reporting). | |
| 37 | * | |
| 38 | * @param methodDescription describes the location (i.e. file name, method name and line number) of the method | |
| 39 | */ | |
| 40 | void setMethodDescription(String methodDescription); | |
| 41 | ||
| 42 | /** | |
| 43 | * Stores a result for the event. Storing a non-null result value may abort the event (at the discretion of the | |
| 44 | * {@link org.apache.tapestry5.ComponentEventCallback}). | |
| 45 | * | |
| 46 | * @param result the result obtained from a method invocations | |
| 47 | * @return true if the event is now aborted | |
| 48 | */ | |
| 49 | boolean storeResult(Object result); | |
| 50 | } |