Resource loader that works with Strings. Users should manually add
resources to the repository that is know by the factory of this package.
Below is an example configuration for this loader.
Note that 'repositoryimpl' is not mandatory;
if not provided, the factory will fall back on using the default
implementation of this package.
string.resource.loader.description = Velocity StringResource loader
string.resource.loader.class = org.apache.velocity.runtime.resource.loader..StringResourceLoader
string.resource.loader.repository.class = org.apache.velocity.runtime.resource.loader.StringResourceRepositoryImpl
Resources can be added to the repository like this:
StringResourceRepository = StringResourceLoader.getRepository();
String myTemplateName = "/somewhere/intherepo/name";
String myTemplateBody = "Hi, ${username}... this is a some template!";
vsRepository.putStringResource(myTemplateName, myTemplateBody);
After this, the templates can be retrieved as usual.
author: Eelco Hillenius author: Henning P. Schmiedehausen version: $Id: StringResourceLoader.java 479058 2006-11-25 00:26:32Z henning $
Get an InputStream so that the Runtime can build a
template with it.
Parameters: name - name of template to get. InputStream containing the template. throws: ResourceNotFoundException - Ff template not foundin the RepositoryFactory.
init
public void init(ExtendedProperties configuration)(Code)