ca.krasnay.scaffold
Class VelocityTemplateProcessor

java.lang.Object
  extended by ca.krasnay.scaffold.VelocityTemplateProcessor
All Implemented Interfaces:
TemplateProcessor

public class VelocityTemplateProcessor
extends Object
implements TemplateProcessor


Constructor Summary
VelocityTemplateProcessor()
           
 
Method Summary
 String process(String template, Map<String,Object> map, boolean isHtml)
          Substitutes a set of values into a template and returns the result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityTemplateProcessor

public VelocityTemplateProcessor()
Method Detail

process

public String process(String template,
                      Map<String,Object> map,
                      boolean isHtml)
               throws TemplateParseException
Description copied from interface: TemplateProcessor
Substitutes a set of values into a template and returns the result.

Specified by:
process in interface TemplateProcessor
Parameters:
template - Template into which to substitute. The particular syntax for specifying where data should be substituted is dependent on the particular template technology being used.
map - Map of values to substitute into the template. Non-string values are converted to strings by calling their toString() method.
isHtml - If true, values being substituted are escaped according to HTML/XML rules, unless the values are instances of RawString. If false, no escaping is performed.
Throws:
TemplateParseException - if the template engine is unable to parse the given template.


Copyright © 2015. All rights reserved.