001: package org.apache.velocity.runtime;
002:
003: /*
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021:
022: /**
023: * This class defines the keys that are used in the velocity.properties file so that they can be referenced as a constant within
024: * Java code.
025: *
026: * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
027: * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
028: * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
029: * @version $Id: RuntimeConstants.java 471372 2006-11-05 06:02:20Z wglass $
030: */
031: public interface RuntimeConstants {
032: /*
033: * ----------------------------------------------------------------------
034: * These are public constants that are used as handles for the
035: * properties that can be specified in your typical
036: * velocity.properties file.
037: * ----------------------------------------------------------------------
038: */
039:
040: /*
041: * ----------------------------------------------------------------------
042: * L O G G I N G C O N F I G U R A T I O N
043: * ----------------------------------------------------------------------
044: */
045:
046: /** Location of the velocity log file. */
047: String RUNTIME_LOG = "runtime.log";
048:
049: /** externally provided logger. */
050: String RUNTIME_LOG_LOGSYSTEM = "runtime.log.logsystem";
051:
052: /** class of log system to use. */
053: String RUNTIME_LOG_LOGSYSTEM_CLASS = "runtime.log.logsystem.class";
054:
055: /**
056: * @deprecated This appears to have always been meaningless.
057: */
058: String RUNTIME_LOG_ERROR_STACKTRACE = "runtime.log.error.stacktrace";
059:
060: /**
061: * @deprecated The functionality this controlled is confusing and no longer necessary.
062: */
063: String RUNTIME_LOG_WARN_STACKTRACE = "runtime.log.warn.stacktrace";
064:
065: /**
066: * @deprecated This appears to have always been meaningless.
067: */
068: String RUNTIME_LOG_INFO_STACKTRACE = "runtime.log.info.stacktrace";
069:
070: /** Logging of invalid references. */
071: String RUNTIME_LOG_REFERENCE_LOG_INVALID = "runtime.log.invalid.references";
072:
073: /**
074: * @deprecated Use LogChute.TRACE_PREFIX instead
075: */
076: String TRACE_PREFIX = " [trace] ";
077:
078: /**
079: * @deprecated Use LogChute.DEBUG_PREFIX instead
080: */
081: String DEBUG_PREFIX = " [debug] ";
082:
083: /**
084: * @deprecated Use LogChute.INFO_PREFIX instead
085: */
086: String INFO_PREFIX = " [info] ";
087:
088: /**
089: * @deprecated Use LogChute.WARN_PREFIX instead
090: */
091: String WARN_PREFIX = " [warn] ";
092:
093: /**
094: * @deprecated Use LogChute.ERROR_PREFIX instead
095: */
096: String ERROR_PREFIX = " [error] ";
097:
098: /**
099: * @deprecated This will be removed in a future version
100: */
101: String UNKNOWN_PREFIX = " [unknown] ";
102:
103: /*
104: * ----------------------------------------------------------------------
105: * D I R E C T I V E C O N F I G U R A T I O N
106: * ----------------------------------------------------------------------
107: * Directive properties are of the form:
108: *
109: * directive.<directive-name>.<property>
110: * ----------------------------------------------------------------------
111: */
112:
113: /** Counter reference name in #foreach directives. */
114: String COUNTER_NAME = "directive.foreach.counter.name";
115:
116: /** Initial counter value in #foreach directives. */
117: String COUNTER_INITIAL_VALUE = "directive.foreach.counter.initial.value";
118:
119: /** Maximum allowed number of loops. */
120: String MAX_NUMBER_LOOPS = "directive.foreach.maxloops";
121:
122: /** if set to true then allows #set to accept null values in the right hand side. */
123: String SET_NULL_ALLOWED = "directive.set.null.allowed";
124:
125: /**
126: * Starting tag for error messages triggered by passing a parameter not allowed in the #include directive. Only string literals,
127: * and references are allowed.
128: */
129: String ERRORMSG_START = "directive.include.output.errormsg.start";
130:
131: /**
132: * Ending tag for error messages triggered by passing a parameter not allowed in the #include directive. Only string literals,
133: * and references are allowed.
134: */
135: String ERRORMSG_END = "directive.include.output.errormsg.end";
136:
137: /** Maximum recursion depth allowed for the #parse directive. */
138: String PARSE_DIRECTIVE_MAXDEPTH = "directive.parse.max.depth";
139:
140: /*
141: * ----------------------------------------------------------------------
142: * 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
143: * ----------------------------------------------------------------------
144: */
145:
146: /** */
147: String RESOURCE_MANAGER_CLASS = "resource.manager.class";
148:
149: /**
150: * The <code>resource.manager.cache.class</code> property specifies the name of the
151: * {@link org.apache.velocity.runtime.resource.ResourceCache} implementation to use.
152: */
153: String RESOURCE_MANAGER_CACHE_CLASS = "resource.manager.cache.class";
154:
155: /** The <code>resource.manager.cache.size</code> property specifies the cache upper bound (if relevant). */
156: String RESOURCE_MANAGER_DEFAULTCACHE_SIZE = "resource.manager.defaultcache.size";
157:
158: /*
159: * ----------------------------------------------------------------------
160: * 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
161: * ----------------------------------------------------------------------
162: */
163:
164: /** controls if the finding of a resource is logged. */
165: String RESOURCE_MANAGER_LOGWHENFOUND = "resource.manager.logwhenfound";
166:
167: /**
168: * Key used to retrieve the names of the resource loaders to be used. In a properties file they may appear as the following:
169: *
170: * <p>resource.loader = file,classpath</p>
171: */
172: String RESOURCE_LOADER = "resource.loader";
173:
174: /** The public handle for setting a path in the FileResourceLoader. */
175: String FILE_RESOURCE_LOADER_PATH = "file.resource.loader.path";
176:
177: /** The public handle for turning the caching on in the FileResourceLoader. */
178: String FILE_RESOURCE_LOADER_CACHE = "file.resource.loader.cache";
179:
180: /*
181: * ----------------------------------------------------------------------
182: * E V E N T H A N D L E R C O N F I G U R A T I O N
183: * ----------------------------------------------------------------------
184: */
185:
186: /**
187: * The <code>eventhandler.referenceinsertion.class</code> property specifies a list of the
188: * {@link org.apache.velocity.app.event.ReferenceInsertionEventHandler} implementations to use.
189: */
190: String EVENTHANDLER_REFERENCEINSERTION = "eventhandler.referenceinsertion.class";
191:
192: /**
193: * The <code>eventhandler.nullset.class</code> property specifies a list of the
194: * {@link org.apache.velocity.app.event.NullSetEventHandler} implementations to use.
195: */
196: String EVENTHANDLER_NULLSET = "eventhandler.nullset.class";
197:
198: /**
199: * The <code>eventhandler.methodexception.class</code> property specifies a list of the
200: * {@link org.apache.velocity.app.event.MethodExceptionEventHandler} implementations to use.
201: */
202: String EVENTHANDLER_METHODEXCEPTION = "eventhandler.methodexception.class";
203:
204: /**
205: * The <code>eventhandler.include.class</code> property specifies a list of the
206: * {@link org.apache.velocity.app.event.IncludeEventHandler} implementations to use.
207: */
208: String EVENTHANDLER_INCLUDE = "eventhandler.include.class";
209:
210: /**
211: * The <code>eventhandler.invalidreferences.class</code> property specifies a list of the
212: * {@link org.apache.velocity.app.event.InvalidReferenceEventHandler} implementations to use.
213: */
214: String EVENTHANDLER_INVALIDREFERENCES = "eventhandler.invalidreferences.class";
215:
216: /*
217: * ----------------------------------------------------------------------
218: * V E L O C I M A C R O C O N F I G U R A T I O N
219: * ----------------------------------------------------------------------
220: */
221:
222: /** Name of local Velocimacro library template. */
223: String VM_LIBRARY = "velocimacro.library";
224:
225: /** Default Velocimacro library template. */
226: String VM_LIBRARY_DEFAULT = "VM_global_library.vm";
227:
228: /** switch for autoloading library-sourced VMs (for development). */
229: String VM_LIBRARY_AUTORELOAD = "velocimacro.library.autoreload";
230:
231: /** boolean (true/false) default true : allow inline (in-template) macro definitions. */
232: String VM_PERM_ALLOW_INLINE = "velocimacro.permissions.allow.inline";
233:
234: /** boolean (true/false) default false : allow inline (in-template) macro definitions to replace existing. */
235: String VM_PERM_ALLOW_INLINE_REPLACE_GLOBAL = "velocimacro.permissions.allow.inline.to.replace.global";
236:
237: /** Switch for forcing inline macros to be local : default false. */
238: String VM_PERM_INLINE_LOCAL = "velocimacro.permissions.allow.inline.local.scope";
239:
240: /** Switch for VM blather : default true. */
241: String VM_MESSAGES_ON = "velocimacro.messages.on";
242:
243: /** switch for local context in VM : default false. */
244: String VM_CONTEXT_LOCALSCOPE = "velocimacro.context.localscope";
245:
246: /** if true, throw an exception for wrong number of arguments **/
247: String VM_ARGUMENTS_STRICT = "velocimacro.arguments.strict";
248:
249: /*
250: * ----------------------------------------------------------------------
251: * 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
252: * ----------------------------------------------------------------------
253: */
254:
255: /** Switch for the interpolation facility for string literals. */
256: String INTERPOLATE_STRINGLITERALS = "runtime.interpolate.string.literals";
257:
258: /** The character encoding for the templates. Used by the parser in processing the input streams. */
259: String INPUT_ENCODING = "input.encoding";
260:
261: /** Encoding for the output stream. Currently used by Anakia and VelocityServlet */
262: String OUTPUT_ENCODING = "output.encoding";
263:
264: /** Default Encoding is ISO-8859-1. */
265: String ENCODING_DEFAULT = "ISO-8859-1";
266:
267: /** key name for uberspector. */
268: String UBERSPECT_CLASSNAME = "runtime.introspector.uberspect";
269:
270: /** A comma separated list of packages to restrict access to in the SecureIntrospector. */
271: String INTROSPECTOR_RESTRICT_PACKAGES = "introspector.restrict.packages";
272:
273: /** A comma separated list of classes to restrict access to in the SecureIntrospector. */
274: String INTROSPECTOR_RESTRICT_CLASSES = "introspector.restrict.classes";
275:
276: /**
277: * The <code>parser.pool.class</code> property specifies the name of the {@link org.apache.velocity.util.SimplePool}
278: * implementation to use.
279: */
280: String PARSER_POOL_CLASS = "parser.pool.class";
281:
282: /**
283: * @see #NUMBER_OF_PARSERS
284: */
285: String PARSER_POOL_SIZE = "parser.pool.size";
286:
287: /*
288: * ----------------------------------------------------------------------
289: * These constants are used internally by the Velocity runtime i.e.
290: * the constants listed below are strictly used in the Runtime
291: * class itself.
292: * ----------------------------------------------------------------------
293: */
294:
295: /** Default Runtime properties. */
296: String DEFAULT_RUNTIME_PROPERTIES = "org/apache/velocity/runtime/defaults/velocity.properties";
297:
298: /** Default Runtime properties. */
299: String DEFAULT_RUNTIME_DIRECTIVES = "org/apache/velocity/runtime/defaults/directive.properties";
300:
301: /**
302: * The default number of parser instances to create. Configurable via the parameter named by the {@link #PARSER_POOL_SIZE}
303: * constant.
304: */
305: int NUMBER_OF_PARSERS = 20;
306:
307: }
|