Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

freemarker.cache: Javadoc index of package freemarker.cache.


Package Samples:

freemarker.cache

Classes:

StringTemplateLoader: 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. if you have to deploy a single jar for JavaWebStart or if they are contained within a database. A single template can be created manually e.g. String templateStr="Hello ${user}"; Template t = new Template("name", new StringReader(templateStr), new Configuration()); If, however, you want to create templates from strings which import other templates this ...
MruCacheStorage: A cache storage that implements a two-level Most Recently Used cache. In the first level, items are strongly referenced up to the specified maximum. When the maximum is exceeded, the least recently used item is moved into the second level cache, where they are softly referenced, up to another specified maximum. When the second level maximum is also exceeded, the least recently used item is discarded altogether. This cache storage is a generalization of both StrongCacheStorage and SoftCacheStorage - the effect of both of them can be achieved by setting one maximum to zero and the other to the largest ...
MultiTemplateLoader: 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. If a request for some template name was already satisfied in the past by one of the loaders, that Loader is queried first (a soft affinity). This class is NOT thread-safe. If it is accessed from multiple threads concurrently, proper synchronization must be provided by the callers. Note that TemplateCache , the natural user of this class provides the necessary synchronizations when it uses the class.
SoftCacheStorage: Strong cache storage is a cache storage that uses java.lang.ref.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. If it is accessed from multiple threads concurrently, proper synchronization must be provided by the callers. Note that TemplateCache , the natural user of this class provides the necessary synchronizations when it uses the class.
StrongCacheStorage: Strong cache storage is a cache storage that simply wraps a java.util.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. If it is accessed from multiple threads concurrently, proper synchronization must be provided by the callers. Note that TemplateCache , the natural user of this class provides the necessary synchronizations when it uses the class.
TemplateLoader: 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. A template loader is plugged into the TemplateCache to provide concrete loading of the templates. The implementations can be coded in a non-threadsafe manner as the natural user of the template loader, TemplateCache does the necessary synchronization.
URLTemplateLoader: This is an abstract template loader that can load templates whose location can be described by an URL. Subclasses only need to override the getURL(String) 55 method. Both ClassTemplateLoader and WebappTemplateLoader are (quite trivial) subclasses of this class.
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 freemarker.template.Configuration .
CacheStorage: Cache storage abstracts away the storage aspects of a cache - associating an object with a key, retrieval and removal via the key. It is actually a small subset of the java.util.Map interface. The implementations can be coded in a non-threadsafe manner as the natural user of the cache storage, TemplateCache does the necessary synchronization.
FileTemplateLoader: A TemplateLoader that uses files in a specified directory as the source of templates. If contains security checks that will prevent it serving templates outside the template directory (like <include /etc/passwd> . It compares canonical paths for this, so templates that are symbolically linked into the template directory from outside of it won't work either.
WebappTemplateLoader: A TemplateLoader that uses streams reachable through ServletContext.getResource(String) > ServletContext.getResource(String) 55 as its source of templates.
ClassTemplateLoader: A TemplateLoader that uses streams reachable through Class.getResourceAsStream(String) > Class.getResourceAsStream(String) 55 as its source of templates.
URLTemplateSource: Wraps a java.net.URL , and implements methods required for a typical template source.

Home | Contact Us | Privacy Policy | Terms of Service