com.github.jknack.handlebars.io
Class ClassTemplateLoader
java.lang.Object
com.github.jknack.handlebars.TemplateLoader
com.github.jknack.handlebars.io.ClassTemplateLoader
public class ClassTemplateLoader
- extends TemplateLoader
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
- Author:
- edgar.espina
|
Method Summary |
protected Reader |
read(String location)
Read the resource from the given URI. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassTemplateLoader
public ClassTemplateLoader(String prefix,
String suffix)
- Creates a new
ClassTemplateLoader.
- Parameters:
prefix - The view prefix. Required.suffix - The view suffix. Required.
ClassTemplateLoader
public ClassTemplateLoader(String prefix)
- Creates a new
ClassTemplateLoader.
- Parameters:
prefix - The view prefix. Required.
ClassTemplateLoader
public ClassTemplateLoader()
- Creates a new
ClassTemplateLoader. It looks for templates
stored in the root of the classpath.
read
protected Reader read(String location)
throws IOException
- Description copied from class:
TemplateLoader
- Read the resource from the given URI.
- Specified by:
read in class TemplateLoader
- Parameters:
location - The resource's location.
- Returns:
- The requested resource or null if not found.
- Throws:
IOException - If the resource cannot be loaded.
Copyright © 2012. All Rights Reserved.