Package ninja.template
Class TemplateEngineXml
- java.lang.Object
-
- ninja.template.TemplateEngineXml
-
- All Implemented Interfaces:
TemplateEngine
@Singleton public class TemplateEngineXml extends Object implements TemplateEngine
-
-
Constructor Summary
Constructors Constructor Description TemplateEngineXml(com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContentType()Get the content type this template engine rendersStringgetSuffixOfTemplatingEngine()For instance returns ".ftl.html" Or .ftl.json.voidinvoke(Context context, Result result)Render the given object to the given context
-
-
-
Method Detail
-
invoke
public void invoke(Context context, Result result)
Description copied from interface:TemplateEngineRender the given object to the given context- Specified by:
invokein interfaceTemplateEngine- Parameters:
context- The context to render toresult- The result to render
-
getContentType
public String getContentType()
Description copied from interface:TemplateEngineGet the content type this template engine renders- Specified by:
getContentTypein interfaceTemplateEngine- Returns:
- The content type this template engine renders
-
getSuffixOfTemplatingEngine
public String getSuffixOfTemplatingEngine()
Description copied from interface:TemplateEngineFor 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
- Specified by:
getSuffixOfTemplatingEnginein interfaceTemplateEngine- Returns:
- name of suffix or null if engine is not using a template on disk.
-
-