1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.binding; |
16 |
| |
17 |
| import org.apache.hivemind.Location; |
18 |
| import org.apache.hivemind.util.Defense; |
19 |
| import org.apache.tapestry.IComponent; |
20 |
| import org.apache.tapestry.coerce.ValueConverter; |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| public class ListenerMethodBinding extends AbstractBinding |
27 |
| { |
28 |
| private final IComponent _component; |
29 |
| |
30 |
| private final String _methodName; |
31 |
| |
32 |
42
| public ListenerMethodBinding(IComponent component, String methodName, String description,
|
33 |
| ValueConverter valueConverter, Location location) |
34 |
| { |
35 |
42
| super(description, valueConverter, location);
|
36 |
| |
37 |
42
| Defense.notNull(component, "component");
|
38 |
42
| Defense.notNull(methodName, "methodName");
|
39 |
| |
40 |
42
| _component = component;
|
41 |
42
| _methodName = methodName;
|
42 |
| } |
43 |
| |
44 |
1
| public Object getComponent()
|
45 |
| { |
46 |
1
| return _component;
|
47 |
| } |
48 |
| |
49 |
24
| public Object getObject()
|
50 |
| { |
51 |
24
| return _component.getListeners().getListener(_methodName);
|
52 |
| } |
53 |
| |
54 |
| } |