Package com.github.jknack.handlebars.io
Class ClassPathTemplateLoader
- java.lang.Object
-
- com.github.jknack.handlebars.io.AbstractTemplateLoader
-
- com.github.jknack.handlebars.io.URLTemplateLoader
-
- com.github.jknack.handlebars.io.ClassPathTemplateLoader
-
- All Implemented Interfaces:
TemplateLoader
public class ClassPathTemplateLoader extends URLTemplateLoader
Load templates from the class-path. A base path can be specified at creation time. By default all the templates are loaded from '/' (a.k.a. root classpath).- Since:
- 0.1.0
-
-
Field Summary
-
Fields inherited from interface com.github.jknack.handlebars.io.TemplateLoader
DEFAULT_PREFIX, DEFAULT_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description ClassPathTemplateLoader()
Creates a newClassPathTemplateLoader
.ClassPathTemplateLoader(java.lang.String prefix)
Creates a newClassPathTemplateLoader
.ClassPathTemplateLoader(java.lang.String prefix, java.lang.String suffix)
Creates a newClassPathTemplateLoader
.
-
Method Summary
-
Methods inherited from class com.github.jknack.handlebars.io.URLTemplateLoader
sourceAt
-
Methods inherited from class com.github.jknack.handlebars.io.AbstractTemplateLoader
getCharset, getPrefix, getSuffix, resolve, setCharset, setPrefix, setSuffix
-
-
-
-
Constructor Detail
-
ClassPathTemplateLoader
public ClassPathTemplateLoader(java.lang.String prefix, java.lang.String suffix)
Creates a newClassPathTemplateLoader
.- Parameters:
prefix
- The view prefix. Required.suffix
- The view suffix. Required.
-
ClassPathTemplateLoader
public ClassPathTemplateLoader(java.lang.String prefix)
Creates a newClassPathTemplateLoader
.- Parameters:
prefix
- The view prefix. Required.
-
ClassPathTemplateLoader
public ClassPathTemplateLoader()
Creates a newClassPathTemplateLoader
. It looks for templates stored in the root of the classpath.
-
-