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