public class TemplateFilter extends Filter
Encoding.FREEMARKER
encoding set.Constructor and Description |
---|
TemplateFilter()
Constructor.
|
TemplateFilter(Context context)
Constructor.
|
TemplateFilter(Context context,
Restlet next)
Constructor.
|
TemplateFilter(Context context,
Restlet next,
java.lang.Object dataModel)
Constructor.
|
TemplateFilter(Context context,
Restlet next,
Resolver<java.lang.Object> dataModel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterHandle(Request request,
Response response) |
protected java.lang.Object |
createDataModel(Request request,
Response response)
Creates the FreeMarker data model for a given call.
|
freemarker.template.Configuration |
getConfiguration()
Returns the FreeMarker configuration.
|
java.lang.Object |
getDataModel()
Returns the template data model common to all calls.
|
void |
setConfiguration(freemarker.template.Configuration config)
Sets the FreeMarker configuration.
|
void |
setDataModel(java.lang.Object dataModel)
Sets the template data model common to all calls.
|
beforeHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public TemplateFilter()
public TemplateFilter(Context context)
context
- The context.public TemplateFilter(Context context, Restlet next)
context
- The context.next
- The next Restlet.public TemplateFilter(Context context, Restlet next, java.lang.Object dataModel)
context
- The context.next
- The next Restlet.dataModel
- The filter's data model.protected void afterHandle(Request request, Response response)
afterHandle
in class Filter
protected java.lang.Object createDataModel(Request request, Response response)
TemplateHashModel
based on the result of
Resolver.createResolver(Request, Response)
. If the
getDataModel()
method has a non null value, it will be used.request
- The handled request.response
- The handled response.public freemarker.template.Configuration getConfiguration()
public java.lang.Object getDataModel()
public void setConfiguration(freemarker.template.Configuration config)
config
- FreeMarker configuration.public void setDataModel(java.lang.Object dataModel)
dataModel
- The template data model common to all calls.Copyright © 2005-2020 Restlet.