public interface TemplateLoader
Strategy interface for loading resources from class path, file system, etc.
A TemplateLoader
provides two important properties:
'.hbs'
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PREFIX
The default view prefix.
|
static String |
DEFAULT_SUFFIX
The default view suffix.
|
Modifier and Type | Method and Description |
---|---|
Charset |
getCharset() |
String |
getPrefix() |
String |
getSuffix() |
String |
resolve(String location)
Resolve a relative location to an absolute location.
|
void |
setCharset(Charset charset)
Set the default charset.
|
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.
|
TemplateSource |
sourceAt(String location)
Get a template source from location.
|
static final String DEFAULT_PREFIX
static final String DEFAULT_SUFFIX
TemplateSource sourceAt(String location) throws IOException
location
- The location of the template source. Required.IOException
- If the template's source can't be resolved.String resolve(String location)
location
- The candidate location.String getPrefix()
String getSuffix()
void setPrefix(String prefix)
prefix
- The prefix that gets prepended to view names when building a
URI.void setSuffix(String suffix)
suffix
- The suffix that gets appended to view names when building a URI.void setCharset(Charset charset)
charset
- Charset.Charset getCharset()
Copyright © 2021. All rights reserved.