Package ninja.template
Interface TemplateEngine
-
- All Known Implementing Classes:
TemplateEngineFreemarker
,TemplateEngineJson
,TemplateEngineJsonP
,TemplateEngineText
,TemplateEngineXml
public interface TemplateEngine
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getContentType()
Get the content type this template engine rendersString
getSuffixOfTemplatingEngine()
For instance returns ".ftl.html" Or .ftl.json.void
invoke(Context context, Result result)
Render the given object to the given context
-
-
-
Method Detail
-
invoke
void invoke(Context context, Result result)
Render the given object to the given context- Parameters:
context
- The context to render toresult
- The result to render
-
getSuffixOfTemplatingEngine
String getSuffixOfTemplatingEngine()
For instance returns ".ftl.html" Or .ftl.json.Or anything else. To display error messages in a nice way...
But Gson for instance does not use a template to render stuff. Therefore it will return null
- Returns:
- name of suffix or null if engine is not using a template on disk.
-
getContentType
String getContentType()
Get the content type this template engine renders- Returns:
- The content type this template engine renders
-
-