|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.jknack.handlebars.TemplateLoader
public abstract class TemplateLoader
Locate resource in a resource repository like: classpath, filesystem, network, web context.
| Field Summary | |
|---|---|
static String |
DEFAULT_PREFIX
The default view prefix. |
static String |
DEFAULT_SUFFIX
The default view suffix. |
| Constructor Summary | |
|---|---|
TemplateLoader()
|
|
| Method Summary | |
|---|---|
String |
getPrefix()
|
String |
getSuffix()
|
Reader |
load(URI uri)
Load the template from a template repository. |
String |
loadAsString(URI uri)
Load the template as string from a template repository. |
protected abstract Reader |
read(String location)
Read the resource from the given URI. |
String |
resolve(String uri)
Resolve the uri to an absolute location. |
void |
setPrefix(String prefix)
Set the prefix that gets prepended to view names when building a URI. |
void |
setSuffix(String suffix)
Set the suffix that gets appended to view names when building a URI. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_PREFIX
public static final String DEFAULT_SUFFIX
| Constructor Detail |
|---|
public TemplateLoader()
| Method Detail |
|---|
public Reader load(URI uri)
throws IOException
uri - The resource's uri. Required.
IOException - If the resource cannot be loaded.
public String loadAsString(URI uri)
throws IOException
uri - The resource's uri. Required.
IOException - If the resource cannot be loaded.public String resolve(String uri)
uri - The candidate uri.
protected abstract Reader read(String location)
throws IOException
location - The resource's location.
IOException - If the resource cannot be loaded.public void setPrefix(String prefix)
prefix - The prefix that gets prepended to view names when building a
URI.public void setSuffix(String suffix)
suffix - The suffix that gets appended to view names when building a
URI.public String getPrefix()
public String getSuffix()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||