org.codehaus.waffle.testing.view.freemarker
Class FreemarkerProcessor

java.lang.Object
  extended by org.codehaus.waffle.testing.view.freemarker.FreemarkerProcessor
All Implemented Interfaces:
ViewProcessor

public class FreemarkerProcessor
extends java.lang.Object
implements ViewProcessor

Freemarker template processor

Author:
Mauro Talevi

Field Summary
 freemarker.template.Configuration configuration
           
 
Constructor Summary
FreemarkerProcessor()
           
FreemarkerProcessor(java.util.Properties properties)
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> createDataModel(java.lang.Object controller)
          Creates an data model for the given controller.
 java.lang.String process(java.lang.String resource, java.util.Map<java.lang.String,java.lang.Object> dataModel)
          Processes template content with given data model
 java.lang.String process(java.lang.String resource, java.lang.Object controller)
          Processes view content with given controller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configuration

public freemarker.template.Configuration configuration
Constructor Detail

FreemarkerProcessor

public FreemarkerProcessor()

FreemarkerProcessor

public FreemarkerProcessor(java.util.Properties properties)
Method Detail

process

public java.lang.String process(java.lang.String resource,
                                java.lang.Object controller)
Description copied from interface: ViewProcessor
Processes view content with given controller

Specified by:
process in interface ViewProcessor
Parameters:
resource - the template resource
controller - the controller instance
Returns:
The processed content

process

public java.lang.String process(java.lang.String resource,
                                java.util.Map<java.lang.String,java.lang.Object> dataModel)
Processes template content with given data model

Specified by:
process in interface ViewProcessor
Parameters:
resource - the template resource
dataModel - the Map holding the data model
Returns:
The processed content

createDataModel

public java.util.Map<java.lang.String,java.lang.Object> createDataModel(java.lang.Object controller)
Creates an data model for the given controller. The data model contains:

Specified by:
createDataModel in interface ViewProcessor
Parameters:
controller - the controller instance
Returns:
A Map


Copyright © 2008. All Rights Reserved.