KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > listener > ListenerMethodHolder


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.Map JavaDoc;
18
19 import org.apache.tapestry.IPage;
20 import org.apache.tapestry.IRequestCycle;
21 import org.apache.tapestry.html.BasePage;
22
23 /**
24  * Used by {@link org.apache.tapestry.listener.TestListenerMapSource}.
25  *
26  * @author Howard M. Lewis Ship
27  * @since 4.0
28  */

29 public class ListenerMethodHolder
30 {
31     private RuntimeException JavaDoc _exception;
32
33     private String JavaDoc _pageName;
34
35     private IPage _page;
36
37     public ListenerMethodHolder()
38     {
39     }
40
41     public ListenerMethodHolder(String JavaDoc pageName)
42     {
43         _pageName = pageName;
44     }
45
46     public ListenerMethodHolder(IPage page)
47     {
48         _page = page;
49     }
50
51     public void wrongTypes(Map JavaDoc map)
52     {
53     }
54
55     public void fred(String JavaDoc string, int count)
56     {
57
58     }
59
60     public void wilma(IRequestCycle cycle, int argument)
61     {
62     }
63
64     public void noMatch(String JavaDoc argument1, double argument2, long argument3)
65     {
66
67     }
68
69     public String JavaDoc returnsString()
70     {
71         return null;
72     }
73
74     public BasePage returnsBasePage()
75     {
76         return null;
77     }
78
79     public IPage returnsPage()
80     {
81         return _page;
82     }
83
84     public String JavaDoc returnsPageName()
85     {
86         return _pageName;
87     }
88
89     public Object JavaDoc returnsObject()
90     {
91         return null;
92     }
93
94     public int returnsInt()
95     {
96         return 0;
97     }
98
99     /**
100      * Tapestry 3.0 and earlier style.
101      */

102
103     public void pebbles(IRequestCycle cycle)
104     {
105     }
106
107     public void barney(String JavaDoc string)
108     {
109
110     }
111
112     public void barney()
113     {
114
115     }
116
117     public String JavaDoc toString()
118     {
119         return "ListenerMethodHolder";
120     }
121
122     public void throwsException()
123     {
124         throw _exception;
125     }
126
127     public void setException(RuntimeException JavaDoc ex)
128     {
129         _exception = ex;
130     }
131 }
Popular Tags