Class CompositeTemplateLoader

java.lang.Object
com.github.jknack.handlebars.io.CompositeTemplateLoader
All Implemented Interfaces:
TemplateLoader

@Deprecated(since="2024-07-10") public class CompositeTemplateLoader extends Object implements 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.

Combine two or more TemplateLoader as a single TemplateLoader. TemplateLoaders are executed in the order they are provided.

Execution is as follows:

Since:
1.0.0
  • Constructor Details

    • CompositeTemplateLoader

      public CompositeTemplateLoader(TemplateLoader... loaders)
      Deprecated.
      Parameters:
      loaders - The template loader chain. At least two loaders must be provided.
  • Method Details

    • sourceAt

      public TemplateSource sourceAt(String location) throws IOException
      Deprecated.
      Description copied from interface: TemplateLoader
      Get a template source from location.
      Specified by:
      sourceAt in interface TemplateLoader
      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

      public String resolve(String location)
      Deprecated.
      Description copied from interface: TemplateLoader
      Resolve a relative location to an absolute location.
      Specified by:
      resolve in interface TemplateLoader
      Parameters:
      location - The candidate location.
      Returns:
      Resolve the uri to an absolute location.
    • getPrefix

      public String getPrefix()
      Deprecated.
      Specified by:
      getPrefix in interface TemplateLoader
      Returns:
      The prefix that gets prepended to view names when building a URI.
    • getSuffix

      public String getSuffix()
      Deprecated.
      Specified by:
      getSuffix in interface TemplateLoader
      Returns:
      The suffix that gets appended to view names when building a URI.
    • setPrefix

      public void setPrefix(String prefix)
      Deprecated.
      Description copied from interface: TemplateLoader
      Set the prefix that gets prepended to view names when building a URI.
      Specified by:
      setPrefix in interface TemplateLoader
      Parameters:
      prefix - The prefix that gets prepended to view names when building a URI.
    • setSuffix

      public void setSuffix(String suffix)
      Deprecated.
      Description copied from interface: TemplateLoader
      Set the suffix that gets appended to view names when building a URI.
      Specified by:
      setSuffix in interface TemplateLoader
      Parameters:
      suffix - The suffix that gets appended to view names when building a URI.
    • setCharset

      public void setCharset(Charset charset)
      Deprecated.
      Description copied from interface: TemplateLoader
      Set the default charset.
      Specified by:
      setCharset in interface TemplateLoader
      Parameters:
      charset - Charset.
    • getCharset

      public Charset getCharset()
      Deprecated.
      Specified by:
      getCharset in interface TemplateLoader
      Returns:
      Charset.
    • getDelegates

      public Iterable<TemplateLoader> getDelegates()
      Deprecated.
      Returns the delegates template loaders.
      Returns:
      The delegates template loaders.