Interface TemplateCache
-
- All Known Implementing Classes:
ConcurrentMapTemplateCache
,HighConcurrencyTemplateCache
,NullTemplateCache
public interface TemplateCache
The template cache system.- Since:
- 0.1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Remove all mappings from the cache.void
evict(TemplateSource source)
Evict the mapping for this source from this cache if it is present.Template
get(TemplateSource source, Parser parser)
Return the value to which this cache maps the specified key.TemplateCache
setReload(boolean reload)
Turn on/off auto reloading of templates.
-
-
-
Method Detail
-
clear
void clear()
Remove all mappings from the cache.
-
evict
void evict(TemplateSource source)
Evict the mapping for this source from this cache if it is present.- Parameters:
source
- the source whose mapping is to be removed from the cache
-
get
Template get(TemplateSource source, Parser parser) throws java.io.IOException
Return the value to which this cache maps the specified key.- Parameters:
source
- source whose associated template is to be returned.parser
- The Handlebars parser.- Returns:
- A template.
- Throws:
java.io.IOException
- If input can't be parsed.
-
setReload
TemplateCache setReload(boolean reload)
Turn on/off auto reloading of templates. Auto reload is done usingTemplateSource.lastModified()
.- Parameters:
reload
- True, for turning off template reload. Default is: false.- Returns:
- This template loader.
-
-