Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
ListenerMap |
|
| 1.0;1 |
1 | // Copyright 2005 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.tapestry.listener; |
|
16 | ||
17 | import java.util.Collection; |
|
18 | ||
19 | import org.apache.hivemind.ApplicationRuntimeException; |
|
20 | import org.apache.tapestry.IActionListener; |
|
21 | ||
22 | /** |
|
23 | * @author Howard M. Lewis Ship |
|
24 | */ |
|
25 | public interface ListenerMap |
|
26 | { |
|
27 | ||
28 | /** |
|
29 | * Gets a listener for the given name (which is both a property name and a |
|
30 | * method name). The listener is created as needed, but is also cached for |
|
31 | * later use. The returned object implements the |
|
32 | * {@link org.apache.tapestry.IActionListener}. |
|
33 | * |
|
34 | * @param name |
|
35 | * the name of the method to invoke (the most appropriate method |
|
36 | * will be selected if there are multiple overloadings of the |
|
37 | * same method name) |
|
38 | * @returns an object implementing {@link IActionListener}. |
|
39 | * @throws ApplicationRuntimeException |
|
40 | * if the listener can not be created. |
|
41 | */ |
|
42 | IActionListener getListener(String name); |
|
43 | ||
44 | /** |
|
45 | * Returns an unmodifiable collection of the names of the listeners |
|
46 | * implemented by the target class. |
|
47 | * |
|
48 | * @since 1.0.6 |
|
49 | */ |
|
50 | Collection getListenerNames(); |
|
51 | ||
52 | /** |
|
53 | * Returns true if this ListenerMapImpl can provide a listener with the |
|
54 | * given name. |
|
55 | * |
|
56 | * @since 2.2 |
|
57 | */ |
|
58 | boolean canProvideListener(String name); |
|
59 | } |