Package org.europa.together.application
Class VelocityRenderer
java.lang.Object
org.europa.together.application.VelocityRenderer
- All Implemented Interfaces:
TemplateRenderer
Implementation of a Template Renderer.
-
Field Summary
Fields inherited from interface org.europa.together.business.TemplateRenderer
FEATURE_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGenerate a String from a template in the classpath and a Map with variables.Generate a String from a template using an external file and a Map with variables.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.
-
Constructor Details
-
VelocityRenderer
public VelocityRenderer()Constructor.
-
-
Method Details
-
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 using an 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
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
-