Interface TemplateLoader

All Known Implementing Classes:
AbstractTemplateLoader, ClassPathTemplateLoader, CompositeTemplateLoader, FileTemplateLoader, ServletContextTemplateLoader, URLTemplateLoader

@Deprecated(since="2024-07-10") public interface TemplateLoader
Deprecated.
com.github.jknack.handlebars.io package is deprecated and marked for removal in subsequent releases which will involve removal of the handlebars dependency in AEM.

Strategy interface for loading resources from class path, file system, etc.

Templates prefix and suffix

A TemplateLoader provides two important properties:

  • prefix: useful for setting a default prefix where templates are stored.
  • suffix: useful for setting a default suffix or file extension for your templates. Default is: '.hbs'
Since:
0.1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated.
    The default view prefix.
    static final String
    Deprecated.
    The default view suffix.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
     
    Deprecated.
     
    Deprecated.
     
    resolve(String location)
    Deprecated.
    Resolve a relative location to an absolute location.
    void
    Deprecated.
    Set the default charset.
    void
    setPrefix(String prefix)
    Deprecated.
    Set the prefix that gets prepended to view names when building a URI.
    void
    setSuffix(String suffix)
    Deprecated.
    Set the suffix that gets appended to view names when building a URI.
    sourceAt(String location)
    Deprecated.
    Get a template source from location.
  • Field Details

  • Method Details

    • sourceAt

      TemplateSource sourceAt(String location) throws IOException
      Deprecated.
      Get a template source from location.
      Parameters:
      location - The location of the template source. Required.
      Returns:
      A new template source.
      Throws:
      IOException - If the template's source can't be resolved.
    • resolve

      String resolve(String location)
      Deprecated.
      Resolve a relative location to an absolute location.
      Parameters:
      location - The candidate location.
      Returns:
      Resolve the uri to an absolute location.
    • getPrefix

      String getPrefix()
      Deprecated.
      Returns:
      The prefix that gets prepended to view names when building a URI.
    • getSuffix

      String getSuffix()
      Deprecated.
      Returns:
      The suffix that gets appended to view names when building a URI.
    • setPrefix

      void setPrefix(String prefix)
      Deprecated.
      Set the prefix that gets prepended to view names when building a URI.
      Parameters:
      prefix - The prefix that gets prepended to view names when building a URI.
    • setSuffix

      void setSuffix(String suffix)
      Deprecated.
      Set the suffix that gets appended to view names when building a URI.
      Parameters:
      suffix - The suffix that gets appended to view names when building a URI.
    • setCharset

      void setCharset(Charset charset)
      Deprecated.
      Set the default charset.
      Parameters:
      charset - Charset.
    • getCharset

      Charset getCharset()
      Deprecated.
      Returns:
      Charset.