KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > velocity > runtime > RuntimeConstants


1 package org.apache.velocity.runtime;
2
3 /*
4  * Copyright 2000-2001,2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 /**
20  * This class defines the keys that are used in the
21  * velocity.properties file so that they can be referenced as a constant
22  * within Java code.
23  *
24  * @author <a HREF="mailto:jon@latchkey.com">Jon S. Stevens</a>
25  * @author <a HREF="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
26  * @author <a HREF="mailto:jvanzyl@apache.org">Jason van Zyl</a>
27  * @version $Id: RuntimeConstants.java,v 1.33.4.1 2004/03/03 23:22:55 geirm Exp $
28  */

29 public interface RuntimeConstants
30 {
31     /*
32      * ----------------------------------------------------------------------
33      * These are public constants that are used as handles for the
34      * properties that can be specified in your typical
35      * velocity.properties file.
36      * ----------------------------------------------------------------------
37      */

38
39     /*
40      * ----------------------------------------------------------------------
41      * L O G G I N G C O N F I G U R A T I O N
42      * ----------------------------------------------------------------------
43      */

44
45     /**
46      * Location of the velocity log file.
47      */

48     public static final String JavaDoc RUNTIME_LOG =
49         "runtime.log";
50     
51     /**
52      * externally provided logger
53      */

54     public static final String JavaDoc RUNTIME_LOG_LOGSYSTEM =
55         "runtime.log.logsystem";
56
57     /**
58      * class of log system to use
59      */

60     public static final String JavaDoc RUNTIME_LOG_LOGSYSTEM_CLASS =
61         "runtime.log.logsystem.class";
62
63     /**
64      * Stack trace output for error messages.
65      */

66     public static final String JavaDoc RUNTIME_LOG_ERROR_STACKTRACE =
67         "runtime.log.error.stacktrace";
68     
69     /**
70      * Stack trace output for warning messages.
71      */

72     public static final String JavaDoc RUNTIME_LOG_WARN_STACKTRACE =
73         "runtime.log.warn.stacktrace";
74     
75     /**
76      * Stack trace output for info messages.
77      */

78     public static final String JavaDoc RUNTIME_LOG_INFO_STACKTRACE =
79         "runtime.log.info.stacktrace";
80
81     /**
82      * Logging of invalid references.
83      */

84     public static final String JavaDoc RUNTIME_LOG_REFERENCE_LOG_INVALID =
85         "runtime.log.invalid.references";
86
87     /**
88      * Log message prefixes
89      */

90     public final static String JavaDoc DEBUG_PREFIX = " [debug] ";
91     public final static String JavaDoc INFO_PREFIX = " [info] ";
92     public final static String JavaDoc WARN_PREFIX = " [warn] ";
93     public final static String JavaDoc ERROR_PREFIX = " [error] ";
94     public final static String JavaDoc UNKNOWN_PREFIX = " [unknown] ";
95
96     /**
97      * Log4J configuration
98      */

99     public final static String JavaDoc LOGSYSTEM_LOG4J_PATTERN =
100         "runtime.log.logsystem.log4j.pattern";
101
102     /**
103      * Log4J configuration
104      */

105     public final static String JavaDoc LOGSYSTEM_LOG4J_FILE_SIZE =
106         "runtime.log.logsystem.log4j.file.size";
107
108     /**
109      * Log4J configuration
110      */

111     public final static String JavaDoc LOGSYSTEM_LOG4J_FILE_BACKUPS =
112         "runtime.log.logsystem.log4j.file.backups";
113
114     /**
115      * Log4J configuration
116      */

117     public final static String JavaDoc LOGSYSTEM_LOG4J_SYSLOGD_HOST =
118         "runtime.log.logsystem.log4j.syslogd.host";
119
120     /**
121      * Log4J configuration
122      */

123     public final static String JavaDoc LOGSYSTEM_LOG4J_SYSLOGD_FACILITY =
124         "runtime.log.logsystem.log4j.syslogd.facility";
125
126     /**
127      * Log4J configuration
128      */

129     public final static String JavaDoc LOGSYSTEM_LOG4J_REMOTE_HOST =
130         "runtime.log.logsystem.log4j.remote.host";
131
132     /**
133      * Log4J configuration
134      */

135     public final static String JavaDoc LOGSYSTEM_LOG4J_REMOTE_PORT =
136         "runtime.log.logsystem.log4j.remote.port";
137
138     /**
139      * Log4J configuration
140      */

141     public final static String JavaDoc LOGSYSTEM_LOG4J_EMAIL_SERVER =
142         "runtime.log.logsystem.log4j.email.server";
143
144     /**
145      * Log4J configuration
146      */

147     public final static String JavaDoc LOGSYSTEM_LOG4J_EMAIL_FROM =
148         "runtime.log.logsystem.log4j.email.from";
149
150     /**
151      * Log4J configuration
152      */

153     public final static String JavaDoc LOGSYSTEM_LOG4J_EMAIL_TO =
154         "runtime.log.logsystem.log4j.email.to";
155
156     /**
157      * Log4J configuration
158      */

159     public final static String JavaDoc LOGSYSTEM_LOG4J_EMAIL_SUBJECT =
160         "runtime.log.logsystem.log4j.email.subject";
161
162     /**
163      * Log4J configuration
164      */

165     public final static String JavaDoc LOGSYSTEM_LOG4J_EMAIL_BUFFER_SIZE =
166         "runtime.log.logsystem.log4j.email.buffer.size";
167
168     /*
169      * ----------------------------------------------------------------------
170      * D I R E C T I V E C O N F I G U R A T I O N
171      * ----------------------------------------------------------------------
172      * Directive properties are of the form:
173      *
174      * directive.<directive-name>.<property>
175      * ----------------------------------------------------------------------
176      */

177
178     /**
179      * Initial counter value in #foreach directives.
180      */

181     public static final String JavaDoc COUNTER_NAME =
182         "directive.foreach.counter.name";
183
184     /**
185      * Initial counter value in #foreach directives.
186      */

187     public static final String JavaDoc COUNTER_INITIAL_VALUE =
188         "directive.foreach.counter.initial.value";
189
190     /**
191      * Starting tag for error messages triggered by passing
192      * a parameter not allowed in the #include directive. Only
193      * string literals, and references are allowed.
194      */

195     public static String JavaDoc ERRORMSG_START =
196         "directive.include.output.errormsg.start";
197     
198     /**
199      * Ending tag for error messages triggered by passing
200      * a parameter not allowed in the #include directive. Only
201      * string literals, and references are allowed.
202      */

203     public static String JavaDoc ERRORMSG_END =
204         "directive.include.output.errormsg.end";
205
206     /**
207      * Maximum recursion depth allowed for the #parse directive.
208      */

209     public static String JavaDoc PARSE_DIRECTIVE_MAXDEPTH
210         = "directive.parse.max.depth";
211
212
213     /*
214      * ----------------------------------------------------------------------
215      * R E S O U R C E M A N A G E R C O N F I G U R A T I O N
216      * ----------------------------------------------------------------------
217      */

218      
219      public static String JavaDoc RESOURCE_MANAGER_CLASS = "resource.manager.class";
220      
221      public static String JavaDoc RESOURCE_MANAGER_CACHE_CLASS =
222                 "resource.manager.cache.class";
223                 
224     /*
225      * ----------------------------------------------------------------------
226      * R E S O U R C E L O A D E R C O N F I G U R A T I O N
227      * ----------------------------------------------------------------------
228      */

229
230     /**
231      * controls if the finding of a resource is logged
232      */

233     public static final String JavaDoc RESOURCE_MANAGER_LOGWHENFOUND =
234         "resource.manager.logwhenfound";
235
236     /**
237      * Key used to retrieve the names of the resource loaders
238      * to be used. In a properties file they may appear as
239      * the following:
240      *
241      * resource.loader = file,classpath
242      */

243     public static final String JavaDoc RESOURCE_LOADER = "resource.loader";
244
245     /**
246      * The public handle for setting a path in
247      * the FileResourceLoader.
248      */

249     public static final String JavaDoc FILE_RESOURCE_LOADER_PATH =
250         "file.resource.loader.path";
251
252     /**
253      * The public handle for turning the caching on in the
254      * FileResourceLoader.
255      */

256     public static final String JavaDoc FILE_RESOURCE_LOADER_CACHE =
257         "file.resource.loader.cache";
258
259     /*
260      * ----------------------------------------------------------------------
261      * V E L O C I M A C R O C O N F I G U R A T I O N
262      * ----------------------------------------------------------------------
263      */

264
265     /**
266      * Name of local Velocimacro library template.
267      */

268     public static final String JavaDoc VM_LIBRARY = "velocimacro.library";
269
270     /**
271      * switch for autoloading library-sourced VMs (for development)
272      */

273     public final static String JavaDoc VM_LIBRARY_AUTORELOAD =
274         "velocimacro.library.autoreload";
275
276     /**
277      * boolean (true/false) default true : allow
278      * inline (in-template) macro definitions
279      */

280     public static final String JavaDoc VM_PERM_ALLOW_INLINE =
281         "velocimacro.permissions.allow.inline";
282
283     /**
284      * boolean (true/false) default false : allow inline
285      * (in-template) macro definitions to replace existing
286      */

287     public final static String JavaDoc VM_PERM_ALLOW_INLINE_REPLACE_GLOBAL =
288         "velocimacro.permissions.allow.inline.to.replace.global";
289     
290     /**
291      * Switch for forcing inline macros to be local : default false.
292      */

293     public final static String JavaDoc VM_PERM_INLINE_LOCAL =
294         "velocimacro.permissions.allow.inline.local.scope";
295
296     /**
297      * Switch for VM blather : default true.
298      */

299     public final static String JavaDoc VM_MESSAGES_ON = "velocimacro.messages.on";
300
301    /**
302     * switch for local context in VM : default false
303     */

304     public final static String JavaDoc VM_CONTEXT_LOCALSCOPE =
305         "velocimacro.context.localscope";
306     
307     /*
308      * ----------------------------------------------------------------------
309      * G E N E R A L R U N T I M E C O N F I G U R A T I O N
310      * ----------------------------------------------------------------------
311      */

312
313     /**
314      * Switch for the interpolation facility for string literals
315      */

316     public static String JavaDoc INTERPOLATE_STRINGLITERALS =
317         "runtime.interpolate.string.literals";
318
319     /**
320      * The character encoding for the templates. Used by the parser in
321      * processing the input streams.
322      */

323     public static final String JavaDoc INPUT_ENCODING = "input.encoding";
324
325     /**
326      * Encoding for the output stream. Currently used by Anakia and
327      * VelocityServlet
328      */

329     public static final String JavaDoc OUTPUT_ENCODING = "output.encoding";
330
331     public static final String JavaDoc ENCODING_DEFAULT = "ISO-8859-1";
332
333     /*
334      * ----------------------------------------------------------------------
335      * These constants are used internally by the Velocity runtime i.e.
336      * the constansts listed below are strictly used in the Runtime
337      * class itself.
338      * ----------------------------------------------------------------------
339      */

340
341     /**
342      * Default Runtime properties.
343      */

344     final static String JavaDoc DEFAULT_RUNTIME_PROPERTIES =
345         "org/apache/velocity/runtime/defaults/velocity.properties";
346
347     /**
348      * Default Runtime properties
349      */

350     final static String JavaDoc DEFAULT_RUNTIME_DIRECTIVES =
351         "org/apache/velocity/runtime/defaults/directive.properties";
352
353     /**
354      * The default number of parser instances to create. Configurable
355      * via the parameter named by the {@link #PARSER_POOL_SIZE}
356      * constant.
357      */

358     final static int NUMBER_OF_PARSERS = 20;
359
360     /**
361      * @see #NUMBER_OF_PARSERS
362      */

363     final static String JavaDoc PARSER_POOL_SIZE = "parser.pool.size";
364
365
366     /**
367      * key name for uberspector
368      */

369     final static String JavaDoc UBERSPECT_CLASSNAME = "runtime.introspector.uberspect";
370 }
371
Popular Tags