public class ContextTemplateLoader extends Object implements freemarker.cache.TemplateLoader
Configuration.setTemplateLoader(TemplateLoader)
method.Constructor and Description |
---|
ContextTemplateLoader(Context context,
Reference baseRef)
Constructor.
|
ContextTemplateLoader(Context context,
String baseUri)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
closeTemplateSource(Object templateSource)
Close the template source.
|
Object |
findTemplateSource(String name)
Finds the object that acts as the source of the template with the given
name.
|
long |
getLastModified(Object templateSource)
Returns the modification time.
|
Reader |
getReader(Object templateSource,
String characterSet)
Returns the reader for the template source.
|
public ContextTemplateLoader(Context context, Reference baseRef)
context
- The Restlet context.baseRef
- The base reference.public void closeTemplateSource(Object templateSource) throws IOException
closeTemplateSource
in interface freemarker.cache.TemplateLoader
templateSource
- The template source Representation
.IOException
public Object findTemplateSource(String name) throws IOException
findTemplateSource
in interface freemarker.cache.TemplateLoader
name
- The template name.Representation
.IOException
public long getLastModified(Object templateSource)
getLastModified
in interface freemarker.cache.TemplateLoader
templateSource
- The template source Representation
.public Reader getReader(Object templateSource, String characterSet) throws IOException
getReader
in interface freemarker.cache.TemplateLoader
templateSource
- The template source Representation
.characterSet
- The reader character set.IOException
Copyright © 2005–2018. All rights reserved.