public class GuavaCachedTemplateLoader extends Object implements TemplateLoader
DEFAULT_PREFIX, DEFAULT_SUFFIX| Constructor and Description |
|---|
GuavaCachedTemplateLoader(TemplateLoader delegate,
com.google.common.cache.Cache<String,TemplateSource> cache) |
| Modifier and Type | Method and Description |
|---|---|
static GuavaCachedTemplateLoader |
cacheWithExpiration(TemplateLoader delegate,
long duration,
TimeUnit unit)
Create a cached template loader that will expire entries if they are not
used after some time.
|
Charset |
getCharset() |
String |
getPrefix() |
String |
getSuffix() |
String |
resolve(String location) |
void |
setCharset(Charset charset) |
void |
setPrefix(String prefix) |
void |
setSuffix(String suffix) |
TemplateSource |
sourceAt(String location) |
public GuavaCachedTemplateLoader(TemplateLoader delegate, com.google.common.cache.Cache<String,TemplateSource> cache)
delegate - wrappped template loader.cache - Guava Cache.public static GuavaCachedTemplateLoader cacheWithExpiration(TemplateLoader delegate, long duration, TimeUnit unit)
delegate - to be decorated.duration - never negative.unit - never null.public TemplateSource sourceAt(String location) throws IOException
sourceAt in interface TemplateLoaderIOExceptionpublic String resolve(String location)
resolve in interface TemplateLoaderpublic String getPrefix()
getPrefix in interface TemplateLoaderpublic String getSuffix()
getSuffix in interface TemplateLoaderpublic void setPrefix(String prefix)
setPrefix in interface TemplateLoaderpublic void setSuffix(String suffix)
setSuffix in interface TemplateLoaderpublic void setCharset(Charset charset)
setCharset in interface TemplateLoaderpublic Charset getCharset()
getCharset in interface TemplateLoaderCopyright © 2022. All rights reserved.