ninja.template
Class TemplateEngineFreemarker

java.lang.Object
  extended by ninja.template.TemplateEngineFreemarker
All Implemented Interfaces:
TemplateEngine

public class TemplateEngineFreemarker
extends Object
implements TemplateEngine


Method Summary
 String getContentType()
          Get the content type this template engine renders
 String getSuffixOfTemplatingEngine()
          For instance returns ".ftl.html" Or .ftl.json.
 void invoke(Context context, Result result)
          Render the given object to the given context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

invoke

public void invoke(Context context,
                   Result result)
Description copied from interface: TemplateEngine
Render the given object to the given context

Specified by:
invoke in interface TemplateEngine
Parameters:
context - The context to render to
result - The result to render

getContentType

public String getContentType()
Description copied from interface: TemplateEngine
Get the content type this template engine renders

Specified by:
getContentType in interface TemplateEngine
Returns:
The content type this template engine renders

getSuffixOfTemplatingEngine

public String getSuffixOfTemplatingEngine()
Description copied from interface: TemplateEngine
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

Specified by:
getSuffixOfTemplatingEngine in interface TemplateEngine
Returns:
name of suffix or null if engine is not using a template on disk.


Copyright © 2012. All Rights Reserved.