Home » freemarker-2.3.13 » freemarker.cache » [javadoc | source]
freemarker.cache
public class: TemplateCache [javadoc | source]
java.lang.Object
   freemarker.cache.TemplateCache
A class that performs caching and on-demand loading of the templates. The actual loading is delegated to a TemplateLoader . Also, various constructors provide you with convenient caches with predefined behavior. Typically you don't use this class directly - in normal circumstances it is hidden behind a Configuration .
Constructor:
 public TemplateCache() 
 public TemplateCache(TemplateLoader loader) 
    Creates a new template cache with a custom template loader that is used to load the templates.
    Parameters:
    loader - the template loader to use.
 public TemplateCache(TemplateLoader loader,
    CacheStorage storage) 
    Creates a new template cache with a custom template loader that is used to load the templates.
    Parameters:
    loader - the template loader to use.
Method from freemarker.cache.TemplateCache Summary:
clear,   getCacheStorage,   getDelay,   getFullTemplatePath,   getLocalizedLookup,   getTemplate,   getTemplateLoader,   setConfiguration,   setDelay,   setLocalizedLookup
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from freemarker.cache.TemplateCache Detail:
 public  void clear() 
 public CacheStorage getCacheStorage() 
 public synchronized long getDelay() 
    Gets the delay in milliseconds between checking for newer versions of a template source.
 public static String getFullTemplatePath(Environment env,
    String parentTemplateDir,
    String templateNameString) 
 public synchronized boolean getLocalizedLookup() 
    Returns if localized template lookup is enabled or not.
 public Template getTemplate(String name,
    Locale locale,
    String encoding,
    boolean parse) throws IOException 
    Loads a template with the given name, in the specified locale and using the specified character encoding.
 public TemplateLoader getTemplateLoader() 
 public  void setConfiguration(Configuration config) 
    Sets the configuration object to which this cache belongs. This method is called by the configuration itself to establish the relation, and should not be called by users.
 public synchronized  void setDelay(long delay) 
    Sets the delay in milliseconds between checking for newer versions of a template sources.
 public synchronized  void setLocalizedLookup(boolean localizedLookup) 
    Setis if localized template lookup is enabled or not.