Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

VelocityEngineFactory Members

VelocityEngineFactory overview

Protected Static (Shared) Fields

logMissing <summary> documentation for F:Spring.Template.Velocity.VelocityEngineFactory.log

Protected Static (Shared) Methods

NewVelocityEngine Return a new VelocityEngine. Subclasses can override this for custom initialization, or for using a mock object for testing.
Called by CreateVelocityEngine()

Public Instance Constructors

VelocityEngineFactory Constructor Initializes a new instance of the VelocityEngineFactory class.

Public Instance Properties

ConfigLocation Set the location of the Velocity config file. Alternatively, you can specify all properties locally.
OverrideLogging Set whether Velocity should log via Commons Logging, i.e. whether Velocity's log system should be set to CommonsLoggingLogSystem. Default value is true
PreferFileSystemAccess Set whether to prefer file system access for template loading. File system access enables hot detection of template changes.
If this is enabled, VelocityEngineFactory will try to resolve the specified "resourceLoaderPath" as file system resource.
Default is "true". Turn this off to always load via SpringResourceLoader (i.e. as stream, without hot detection of template changes), which might be necessary if some of your templates reside in a directory while others reside in assembly files.
ResourceLoader Set the Spring ResourceLoader to use for loading Velocity template files. The default is DefaultResourceLoader. Will get overridden by the ApplicationContext if running in a context.
ResourceLoaderPath Single ResourceLoaderPath
ResourceLoaderPaths Set the Velocity resource loader path via a Spring resource location. Accepts multiple locations in Velocity's comma-separated path style.
When populated via a String, standard URLs like "file:" and "assembly:" pseudo URLs are supported, as understood by IResourceLoader. Allows for relative paths when running in an ApplicationContext.
Will define a path for the default Velocity resource loader with the name "file". If the specified resource cannot be resolved to a File, a generic SpringResourceLoader will be used under the name "spring", without modification detection.
Take notice that resource caching will be enabled in any case. With the file resource loader, the last-modified timestamp will be checked on access to detect changes. With SpringResourceLoader, the resource will be throughout the life time of the application context (for example for class path resources).
To specify a modification check interval for files, use Velocity's standard "file.resource.loader.modificationCheckInterval" property. By default, the file timestamp is checked on every access (which is surprisingly fast). Of course, this just applies when loading resources from the file system.
To enforce the use of SpringResourceLoader, i.e. to not resolve a path as file system resource in any case, turn off the "preferFileSystemAccess" flag. See the latter's documentation for details.
VelocityProperties Set local NVelocity properties.

Public Instance Methods

CreateVelocityEngine Create and initialize the VelocityEngine instance and return it
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
ToString (inherited from Object)Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
InitSpringResourceLoader Initialize a SpringResourceLoader for the given VelocityEngine.
Called by
. Important: the NVeloctity ResourceLoaderFactory.getLoader method replaces ';' with ',' when attempting to construct our resource loader. The name on the SPRING_RESOURCE_LOADER_CLASS property has to be in the form of "ClassFullName; AssemblyName" in replacement of the tranditional "ClassFullName, AssemblyName" to work.
InitVelocityResourceLoader Initialize a Velocity resource loader for the given VelocityEngine: either a standard Velocity FileResourceLoader or a SpringResourceLoader.
Called by
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.
PostProcessVelocityEngine To be implemented by subclasses that want to to perform custom post-processing of the VelocityEngine after this FactoryObject performed its default configuration (but before VelocityEngine.init)
Called by CreateVelocityEngine

See Also

VelocityEngineFactory Class | Spring.Template.Velocity Namespace