freemarker.cache (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.cache

# Package freemarker.cache

package freemarker.cache
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.

- Interface Summary
  Interface
  Description
  CacheStorage
  Cache storage abstracts away the storage aspects of a cache - associating an object with a key, retrieval and removal via the key.
  CacheStorageWithGetSize
  A cache storage that has a `getSize()` method for returning the current number of cache entries.
  ConcurrentCacheStorage
  An optional interface for cache storage that knows whether it can be concurrently accessible without synchronization.
  StatefulTemplateLoader
  Interface that can be implemented by `TemplateLoader`-s that maintain some sort of internal state (i.e.
  TemplateLoader
  FreeMarker loads template "files" through objects that implement this interface, thus the templates need not be real files, and can come from any kind of data source (like classpath, servlet context, database, etc).
- Class Summary
  Class
  Description
  AndMatcher
  Logical "and" operation among the given matchers.
  ByteArrayTemplateLoader
  A `TemplateLoader` that uses a `Map` with `byte[]` as its source of templates.
  ClassTemplateLoader
  A `TemplateLoader` that can load templates from the "classpath".
  ConditionalTemplateConfigurationFactory
  Returns the given `TemplateConfiguration` directly, or another `TemplateConfigurationFactory`'s result, when the specified matcher matches the template source.
  FileExtensionMatcher
  Matches the file extension; unlike other matchers, by default case insensitive.
  FileNameGlobMatcher
  As opposed to `PathGlobMatcher`, it only compares the "file name" part (the part after the last `/`) of the source name with the given glob.
  FileTemplateLoader
  A `TemplateLoader` that uses files inside a specified directory as the source of templates.
  FirstMatchTemplateConfigurationFactory
  Returns the first non-`null` result of the child factories, ignoring all further child factories.
  MergingTemplateConfigurationFactory
  Returns the merged results of all the child factories.
  MruCacheStorage
  A cache storage that implements a two-level Most Recently Used cache.
  MultiTemplateLoader
  A `TemplateLoader` that uses a set of other loaders to load the templates.
  NotMatcher
  Logical "not" operation on the given matcher.
  NullCacheStorage
  A cache storage that doesn't store anything.
  OrMatcher
  Logical "or" operation among the given matchers.
  PathGlobMatcher
  Matches the whole template source name (also known as template source path) with the given glob.
  PathRegexMatcher
  Matches the whole template source name (also known as template source path) with the given regular expression.
  SoftCacheStorage
  Soft 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.
  StringTemplateLoader
  A `TemplateLoader` that uses a `Map` with `String`-s as its source of templates.
  StrongCacheStorage
  Strong cache storage is a cache storage that simply wraps a `Map`.
  TemplateCache
  Performs caching and on-demand loading of the templates.
  TemplateCache.MaybeMissingTemplate
  Return value of `TemplateCache.getTemplate(String, Locale, Object, String, boolean)`.
  TemplateConfigurationFactory
  Creates (or returns) `TemplateConfiguration`-s for template sources.
  TemplateLoaderUtils
  TemplateLookupContext
  Used as the parameter of `TemplateLookupStrategy.lookup(TemplateLookupContext)`.
  TemplateLookupResult
  The return value of `TemplateLookupStrategy.lookup(TemplateLookupContext)` and similar lookup methods.
  TemplateLookupStrategy
  Finds the `TemplateLoader`-level (storage-level) template source for the template name with which the template was requested (as in `Configuration.getTemplate(String)`).
  TemplateNameFormat
  Symbolizes a template name format, which defines the basic syntax of names through algorithms such as normalization.
  TemplateSourceMatcher
  URLTemplateLoader
  This is an abstract template loader that can load templates whose location can be described by an URL.
  URLTemplateSource
  Wraps a `URL`, and implements methods required for a typical template source.
  WebappTemplateLoader
  A `TemplateLoader` that uses streams reachable through `ServletContext.getResource(String)` as its source of templates.
- Exception Summary
  Exception
  Description
  TemplateConfigurationFactoryException
  Non-I/O exception thrown by `TemplateConfigurationFactory`-s.