1. Project Clover database Wed Jan 17 2024 23:40:18 CST
  2. Package org.europa.together.business

File TemplateRenderer.java

 

Code metrics

0
0
0
1
61
19
0
-
-
0
-

Classes

Class Line # Actions
TemplateRenderer 17 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package org.europa.together.business;
2   
3    import java.util.Map;
4    import org.apiguardian.api.API;
5    import static org.apiguardian.api.API.Status.STABLE;
6    import org.springframework.stereotype.Component;
7   
8    /**
9    * Wrapper for the Velocity Template Renderer.
10    *
11    * @author elmar.dott@gmail.com
12    * @version 1.2
13    * @since 1.0
14    */
15    @API(status = STABLE, since = "1.0", consumers = "VelocityRenderer")
16    @Component
 
17    public interface TemplateRenderer {
18   
19    /**
20    * Identifier for the given feature.
21    */
22    @API(status = STABLE, since = "1.2")
23    String FEATURE_ID = "CM-03";
24   
25    /**
26    * Generate a String from a template in the classpath and a Map with
27    * variables.
28    *
29    * @param resourcePath as String
30    * @param template as String
31    * @param properties as Map
32    * @return processedTemplate as String
33    */
34    @API(status = STABLE, since = "1.0")
35    String loadContentByClasspathResource(String resourcePath, String template,
36    Map<String, String> properties);
37   
38    /**
39    * Generate a String from a template using an external file and a Map with
40    * variables.
41    *
42    * @param resourcePath as String
43    * @param template as String
44    * @param properties as Map
45    * @return processedTemplate as String
46    */
47    @API(status = STABLE, since = "1.0")
48    String loadContentByFileResource(String resourcePath, String template,
49    Map<String, String> properties);
50   
51    /**
52    * Render a template (resource) with a Map of variables from an input String
53    * and process the output also as String.
54    *
55    * @param resource as String
56    * @param properties as Map
57    * @return processedTemplate as String
58    */
59    @API(status = STABLE, since = "1.0")
60    String loadContentByStringResource(String resource, Map<String, String> properties);
61    }