Enum NullTemplateCache
- java.lang.Object
-
- java.lang.Enum<NullTemplateCache>
-
- com.github.jknack.handlebars.cache.NullTemplateCache
-
- All Implemented Interfaces:
TemplateCache
,java.io.Serializable
,java.lang.Comparable<NullTemplateCache>
public enum NullTemplateCache extends java.lang.Enum<NullTemplateCache> implements TemplateCache
Null cache implementation.- Since:
- 0.11.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
Shared instance of null cache.
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.NullTemplateCache
setReload(boolean reload)
Turn on/off auto reloading of templates.static NullTemplateCache
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static NullTemplateCache[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final NullTemplateCache INSTANCE
Shared instance of null cache.
-
-
Method Detail
-
values
public static NullTemplateCache[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NullTemplateCache c : NullTemplateCache.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NullTemplateCache valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
clear
public void clear()
Description copied from interface:TemplateCache
Remove all mappings from the cache.- Specified by:
clear
in interfaceTemplateCache
-
evict
public void evict(TemplateSource source)
Description copied from interface:TemplateCache
Evict the mapping for this source from this cache if it is present.- Specified by:
evict
in interfaceTemplateCache
- Parameters:
source
- the source whose mapping is to be removed from the cache
-
setReload
public NullTemplateCache setReload(boolean reload)
Description copied from interface:TemplateCache
Turn on/off auto reloading of templates. Auto reload is done usingTemplateSource.lastModified()
.- Specified by:
setReload
in interfaceTemplateCache
- Parameters:
reload
- True, for turning off template reload. Default is: false.- Returns:
- This template loader.
-
get
public Template get(TemplateSource source, Parser parser) throws java.io.IOException
Description copied from interface:TemplateCache
Return the value to which this cache maps the specified key.- Specified by:
get
in interfaceTemplateCache
- 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.
-
-