freemarker.cache |
Contains classes and interfaces that deal with template loading and caching.
Beside the actual template cache, it contains loaders that can load template
files from the file system, from the classpath, or from a web application
context. If you have specific needs, you can plug custom template loaders into
the system by implementing the template loader interface.
|
Java Source File Name | Type | Comment |
CacheStorage.java | Interface | Cache storage abstracts away the storage aspects of a cache - associating
an object with a key, retrieval and removal via the key. |
ClassTemplateLoader.java | Class | A
TemplateLoader that uses streams reachable through
Class.getResourceAsStream(String) as its source of templates. |
FileTemplateLoader.java | Class | A
TemplateLoader that uses files in a specified directory as the
source of templates. |
MruCacheStorage.java | Class | A cache storage that implements a two-level Most Recently Used cache. |
MultiTemplateLoader.java | Class | A
TemplateLoader that uses a set of other loaders to load the templates.
On every request, loaders are queried in the order of their appearance in the
array of loaders that this Loader owns. |
SoftCacheStorage.java | Class | Strong cache storage is a cache storage that uses
SoftReference
objects to hold the objects it was passed, therefore allows the garbage
collector to purge the cache when it determines that it wants to free up
memory.
This class is NOT thread-safe. |
StatefulTemplateLoader.java | Interface | Interface that can be implemented by template loaders that maintain some
sort of internal state (i.e. |
StringTemplateLoader.java | Class | A
TemplateLoader that uses a Map with Strings as its source of
templates.
In most case the regular way of loading templates from files will be fine.
However, there can be situations where you don't want to or can't load a
template from a file, e.g. |
StrongCacheStorage.java | Class | Strong cache storage is a cache storage that simply wraps a
HashMap .
It holds a strong reference to all objects it was passed, therefore prevents
the cache from being purged during garbage collection.
This class is NOT thread-safe. |
TemplateCache.java | Class | A class that performs caching and on-demand loading of the templates.
The actual loading is delegated to a
TemplateLoader . |
TemplateLoader.java | Interface | A template loader is an object that can find the source stream for a
template, can retrieve its time of last modification as well as the stream
itself. |
URLTemplateLoader.java | Class | This is an abstract template loader that can load templates whose
location can be described by an URL. |
URLTemplateSource.java | Class | Wraps a java.net.URL , and implements methods required for a typical template source. |
WebappTemplateLoader.java | Class | A
TemplateLoader that uses streams reachable through
ServletContext.getResource(String) as its source of templates. |