/**
* Create a VelocityEngine instance configured with the given libs string
*/
private static final VelocityEngine createEngine(String lib)
{
VelocityEngine ve = new VelocityEngine();
// use our logger, and customize log settings
ve.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, LOGSYSTEM_CLASS);
ve.setProperty(Velocity.RUNTIME_LOG_ERROR_STACKTRACE, "false");
ve.setProperty(Velocity.RUNTIME_LOG_REFERENCE_LOG_INVALID, "true");
// use our strict introspection
ve.setProperty(Velocity.UBERSPECT_CLASSNAME, STRICT_UBERSPECT_IMPL_CLASS);
// load from classpath and file system
ve.setProperty(Velocity.RESOURCE_LOADER, "file,class");
// configure class resource loader
ve.setProperty("class." + Velocity.RESOURCE_LOADER + ".class", CLASSPATH_RESOURCE_LOADER_CLASS);
// libs are precompiled in later in this function
ve.setProperty(Velocity.VM_LIBRARY, "");
// initialize
try
{
ve.init();
}
catch (Exception e)
{
ThreadLocalToolkit.log(new InitializationError(e.getLocalizedMessage()));
}