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
Constructors -
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:TemplateRendererGenerate a String from a template in the classpath and a Map with variables.- Specified by:
loadContentByClasspathResourcein 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:TemplateRendererGenerate a String from a template using an external file and a Map with variables.- Specified by:
loadContentByFileResourcein interfaceTemplateRenderer- Parameters:
resourcePath- as Stringtemplate- as Stringproperties- as Map- Returns:
- processedTemplate as String
-
loadContentByStringResource
Description copied from interface:TemplateRendererRender a template (resource) with a Map of variables from an input String and process the output also as String.- Specified by:
loadContentByStringResourcein interfaceTemplateRenderer- Parameters:
resource- as Stringproperties- as Map- Returns:
- processedTemplate as String
-