ninja.template
Interface TemplateEngine

All Known Implementing Classes:
TemplateEngineFreemarker, TemplateEngineJsonGson

public interface 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
 

Method Detail

invoke

void invoke(Context context,
            Result result)
Render the given object to the given context

Parameters:
context - The context to render to
result - 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


Copyright © 2012. All Rights Reserved.