org.codehaus.waffle.testing.view
Interface ViewProcessor

All Known Implementing Classes:
FreemarkerProcessor

public interface ViewProcessor

ViewProcessor abstracts the view processing implemented by different template engines, eg Freemarker, Velocity etc. The view expects a single controller instance under key "controller".

Author:
Mauro Talevi

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
 

Method Detail

process

java.lang.String process(java.lang.String resource,
                         java.lang.Object controller)
Processes view content with given controller

Parameters:
resource - the template resource
controller - the controller instance
Returns:
The processed content

process

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

Parameters:
resource - the template resource
dataModel - the Map holding the data model
Returns:
The processed content

createDataModel

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:

Parameters:
controller - the controller instance
Returns:
A Map


Copyright © 2008. All Rights Reserved.