Package org.europa.together.application
Class VelocityRenderer
- java.lang.Object
-
- org.europa.together.application.VelocityRenderer
-
- All Implemented Interfaces:
TemplateRenderer
@Repository @FeatureToggle(featureID="CM-0003") public class VelocityRenderer extends Object implements TemplateRenderer
Implementation of a VelocityRenderer.
-
-
Field Summary
-
Fields inherited from interface org.europa.together.business.TemplateRenderer
FEATURE_ID
-
-
Constructor Summary
Constructors Constructor Description VelocityRenderer()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
loadContentByClasspathResource(String resourcePath, String template, Map<String,String> properties)
Generate a String from a Template in the classpath and a Map with Variables.String
loadContentByFileResource(String resourcePath, String template, Map<String,String> properties)
Generate a String from a Template from a external File and a Map with Variables.String
loadContentByStringResource(String resource, Map<String,String> properties)
Render a Template (resource) with a Map of Variables from an input String and process the output also as String.
-
-
-
Method Detail
-
loadContentByClasspathResource
public String loadContentByClasspathResource(String resourcePath, String template, Map<String,String> properties)
Description copied from interface:TemplateRenderer
Generate a String from a Template in the classpath and a Map with Variables.- Specified by:
loadContentByClasspathResource
in interfaceTemplateRenderer
- Parameters:
resourcePath
- as Stringtemplate
- as Stringproperties
- as Map- Returns:
- processedTemplate as String
-
loadContentByFileResource
public String loadContentByFileResource(String resourcePath, String template, Map<String,String> properties)
Description copied from interface:TemplateRenderer
Generate a String from a Template from a external File and a Map with Variables.- Specified by:
loadContentByFileResource
in interfaceTemplateRenderer
- Parameters:
resourcePath
- as Stringtemplate
- as Stringproperties
- as Map- Returns:
- processedTemplate as String
-
loadContentByStringResource
public String loadContentByStringResource(String resource, Map<String,String> properties)
Description copied from interface:TemplateRenderer
Render a Template (resource) with a Map of Variables from an input String and process the output also as String.- Specified by:
loadContentByStringResource
in interfaceTemplateRenderer
- Parameters:
resource
- as Stringproperties
- as Map- Returns:
- processedTemplate as String
-
-