Enum NullTemplateCache

java.lang.Object
java.lang.Enum<NullTemplateCache>
com.github.jknack.handlebars.cache.NullTemplateCache
All Implemented Interfaces:
TemplateCache, Serializable, Comparable<NullTemplateCache>, java.lang.constant.Constable

public enum NullTemplateCache extends Enum<NullTemplateCache> implements TemplateCache
Null cache implementation.
Since:
0.11.0
  • Enum Constant Details

    • INSTANCE

      public static final NullTemplateCache INSTANCE
      Shared instance of null cache.
  • Method Details

    • values

      public static NullTemplateCache[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static NullTemplateCache valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      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 interface TemplateCache
    • 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 interface TemplateCache
      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 using TemplateSource.lastModified().
      Specified by:
      setReload in interface TemplateCache
      Parameters:
      reload - True, for turning off template reload. Default is: false.
      Returns:
      This template loader.
    • get

      public Template get(TemplateSource source, Parser parser) throws IOException
      Description copied from interface: TemplateCache
      Return the value to which this cache maps the specified key.
      Specified by:
      get in interface TemplateCache
      Parameters:
      source - source whose associated template is to be returned.
      parser - The Handlebars parser.
      Returns:
      A template.
      Throws:
      IOException - If input can't be parsed.