1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.jelly.tags.fmt;
18
19 import org.apache.commons.jelly.JellyContext;
20
21
22 /***
23 * Class supporting access to configuration data.
24 * @author <a href="mailto:willievu@yahoo.com">Willie Vu</a>
25 * @version 1.1
26 */
27 public class Config {
28
29
30
31
32
33 /***
34 * Name of configuration setting for application- (as opposed to browser-)
35 * based preferred locale
36 */
37 public static final String FMT_LOCALE
38 = "org.apache.commons.jelly.tags.fmt.locale";
39
40 /***
41 * Name of configuration setting for fallback locale
42 */
43 public static final String FMT_FALLBACK_LOCALE
44 = "org.apache.commons.jelly.tags.fmt.fallbackLocale";
45
46 /***
47 * Name of configuration setting for i18n localization context
48 */
49 public static final String FMT_LOCALIZATION_CONTEXT
50 = "org.apache.commons.jelly.tags.fmt.localizationContext";
51
52 /***
53 * Name of localization setting for time zone
54 */
55 public static final String FMT_TIME_ZONE
56 = "org.apache.commons.jelly.tags.fmt.timeZone";
57
58
59 /***
60 * Looks up a configuration variable in the given scope.
61 *
62 * <p> The lookup of configuration variables is performed as if each scope
63 * had its own name space, that is, the same configuration variable name
64 * in one scope does not replace one stored in a different scope.
65 *
66 * @param jc Page context in which the configuration variable is to be
67 * looked up
68 * @param name Configuration variable name
69 * @param scope Scope in which the configuration variable is to be looked
70 * up
71 *
72 * @return The <tt>java.lang.Object</tt> associated with the configuration
73 * variable, or null if it is not defined.
74 */
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90 /***
91 * Looks up a configuration variable in the "request" scope.
92 *
93 * <p> The lookup of configuration variables is performed as if each scope
94 * had its own name space, that is, the same configuration variable name
95 * in one scope does not replace one stored in a different scope.
96 *
97 * @param request Request object in which the configuration variable is to
98 * be looked up
99 * @param name Configuration variable name
100 *
101 * @return The <tt>java.lang.Object</tt> associated with the configuration
102 * variable, or null if it is not defined.
103 */
104
105
106
107
108 /***
109 * Looks up a configuration variable in the "session" scope.
110 *
111 * <p> The lookup of configuration variables is performed as if each scope
112 * had its own name space, that is, the same configuration variable name
113 * in one scope does not replace one stored in a different scope.
114 *
115 * @param session Session object in which the configuration variable is to
116 * be looked up
117 * @param name Configuration variable name
118 *
119 * @return The <tt>java.lang.Object</tt> associated with the configuration
120 * variable, or null if it is not defined.
121 */
122
123
124
125
126 /***
127 * Looks up a configuration variable in the "application" scope.
128 *
129 * <p> The lookup of configuration variables is performed as if each scope
130 * had its own name space, that is, the same configuration variable name
131 * in one scope does not replace one stored in a different scope.
132 *
133 * @param context Servlet context in which the configuration variable is
134 * to be looked up
135 * @param name Configuration variable name
136 *
137 * @return The <tt>java.lang.Object</tt> associated with the configuration
138 * variable, or null if it is not defined.
139 */
140
141
142
143
144 /***
145 * Sets the value of a configuration variable in the given scope.
146 *
147 * <p> Setting the value of a configuration variable is performed as if
148 * each scope had its own namespace, that is, the same configuration
149 * variable name in one scope does not replace one stored in a different
150 * scope.
151 *
152 * @param jc Page context in which the configuration variable is to be set
153 * @param name Configuration variable name
154 * @param value Configuration variable value
155 * @param scope Scope in which the configuration variable is to be set
156 */
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177 /***
178 * Sets the value of a configuration variable in the "request" scope.
179 *
180 * <p> Setting the value of a configuration variable is performed as if
181 * each scope had its own namespace, that is, the same configuration
182 * variable name in one scope does not replace one stored in a different
183 * scope.
184 *
185 * @param request Request object in which the configuration variable is to
186 * be set
187 * @param name Configuration variable name
188 * @param value Configuration variable value
189 */
190
191
192
193
194 /***
195 * Sets the value of a configuration variable in the "session" scope.
196 *
197 * <p> Setting the value of a configuration variable is performed as if
198 * each scope had its own namespace, that is, the same configuration
199 * variable name in one scope does not replace one stored in a different
200 * scope.
201 *
202 * @param session Session object in which the configuration variable is to
203 * be set
204 * @param name Configuration variable name
205 * @param value Configuration variable value
206 */
207
208
209
210
211 /***
212 * Sets the value of a configuration variable in the "application" scope.
213 *
214 * <p> Setting the value of a configuration variable is performed as if
215 * each scope had its own namespace, that is, the same configuration
216 * variable name in one scope does not replace one stored in a different
217 * scope.
218 *
219 * @param context Servlet context in which the configuration variable is to
220 * be set
221 * @param name Configuration variable name
222 * @param value Configuration variable value
223 */
224
225
226
227
228 /***
229 * Removes a configuration variable from the given scope.
230 *
231 * <p> Removing a configuration variable is performed as if each scope had
232 * its own namespace, that is, the same configuration variable name in one
233 * scope does not impact one stored in a different scope.
234 *
235 * @param jc Page context from which the configuration variable is to be
236 * removed
237 * @param name Configuration variable name
238 * @param scope Scope from which the configuration variable is to be
239 * removed
240 */
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260 /***
261 * Removes a configuration variable from the "request" scope.
262 *
263 * <p> Removing a configuration variable is performed as if each scope had
264 * its own namespace, that is, the same configuration variable name in one
265 * scope does not impact one stored in a different scope.
266 *
267 * @param request Request object from which the configuration variable is
268 * to be removed
269 * @param name Configuration variable name
270 */
271
272
273
274
275 /***
276 * Removes a configuration variable from the "session" scope.
277 *
278 * <p> Removing a configuration variable is performed as if each scope had
279 * its own namespace, that is, the same configuration variable name in one
280 * scope does not impact one stored in a different scope.
281 *
282 * @param session Session object from which the configuration variable is
283 * to be removed
284 * @param name Configuration variable name
285 */
286
287
288
289
290 /***
291 * Removes a configuration variable from the "application" scope.
292 *
293 * <p> Removing a configuration variable is performed as if each scope had
294 * its own namespace, that is, the same configuration variable name in one
295 * scope does not impact one stored in a different scope.
296 *
297 * @param context Servlet context from which the configuration variable is
298 * to be removed
299 * @param name Configuration variable name
300 */
301
302
303
304
305 /***
306 * Finds the value associated with a specific configuration setting
307 * identified by its context initialization parameter name.
308 *
309 * <p> For each of the JSP scopes (page, request, session, application),
310 * get the value of the configuration variable identified by <tt>name</tt>
311 * using method <tt>get()</tt>. Return as soon as a non-null value is
312 * found. If no value is found, get the value of the context initialization
313 * parameter identified by <tt>name</tt>.
314 *
315 * @param jc Page context in which the configuration setting is to be
316 * searched
317 * @param name Context initialization parameter name of the configuration
318 * setting
319 *
320 * @return The <tt>java.lang.Object</tt> associated with the configuration
321 * setting identified by <tt>name</tt>, or null if it is not defined.
322 */
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343 }