Class VelocityRenderer

java.lang.Object
org.europa.together.application.VelocityRenderer
All Implemented Interfaces:
TemplateRenderer

@Repository public class VelocityRenderer extends Object implements TemplateRenderer
Implementation of a Template Renderer.
  • 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 interface TemplateRenderer
      Parameters:
      resourcePath - as String
      template - as String
      properties - 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 interface TemplateRenderer
      Parameters:
      resourcePath - as String
      template - as String
      properties - 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 interface TemplateRenderer
      Parameters:
      resource - as String
      properties - as Map
      Returns:
      processedTemplate as String