jste.template
Class TemplateCache

java.lang.Object
  extended by jste.template.TemplateCache

public class TemplateCache
extends java.lang.Object

A cache of Template instances for strings drawn from a repository. For example, using the FileRepository, we can create a TemplateCache that contains files under a particular directory.


Constructor Summary
TemplateCache(Repository rep)
          Create a TemplateCache that contains files from the given repository.
 
Method Summary
 Template getTemplate(java.lang.String templateName)
          Return the template with the given name, if one exists in the cache.
 Repository repository()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateCache

public TemplateCache(Repository rep)
Create a TemplateCache that contains files from the given repository.

Method Detail

repository

public Repository repository()

getTemplate

public Template getTemplate(java.lang.String templateName)
                     throws java.lang.Exception
Return the template with the given name, if one exists in the cache. This method automatically refreshes the cache from the repository if the content in the cache is out of date.

Throws:
java.lang.Exception