org.codehaus.waffle.testing.view.freemarker
Class FreemarkerProcessor
java.lang.Object
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
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 |
configuration
public freemarker.template.Configuration configuration
FreemarkerProcessor
public FreemarkerProcessor()
FreemarkerProcessor
public FreemarkerProcessor(java.util.Properties properties)
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 resourcecontroller
- 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 resourcedataModel
- 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:
- "base": ""
- "controller": controller instance
- "errors": the default errors context
- "messages": the default messages context
- Specified by:
createDataModel
in interface ViewProcessor
- Parameters:
controller
- the controller instance
- Returns:
- A Map
Copyright © 2008. All Rights Reserved.