public class ConcurrentMapTemplateCache extends java.lang.Object implements TemplateCache
TemplateCache
built on top of ConcurrentHashMap
.Constructor and Description |
---|
ConcurrentMapTemplateCache()
Creates a new ConcurrentMapTemplateCache.
|
Modifier and Type | Method and 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.
|
ConcurrentMapTemplateCache |
setReload(boolean reload)
Turn on/off auto reloading of templates.
|
public ConcurrentMapTemplateCache()
public void clear()
TemplateCache
clear
in interface TemplateCache
public void evict(TemplateSource source)
TemplateCache
evict
in interface TemplateCache
source
- the source whose mapping is to be removed from the cachepublic Template get(TemplateSource source, Parser parser) throws java.io.IOException
TemplateCache
get
in interface TemplateCache
source
- source whose associated template is to be returned.parser
- The Handlebars parser.java.io.IOException
- If input can't be parsed.public ConcurrentMapTemplateCache setReload(boolean reload)
TemplateCache
TemplateSource.lastModified()
.setReload
in interface TemplateCache
reload
- True, for turning off template reload. Default is: false.Copyright © 2010 - 2020 Adobe. All Rights Reserved