Interface TemplateManager
-
public interface TemplateManagerTemplateManager which will merge the template and values together.- Since:
- 2018-10-01
- Version:
- 1.0.0
- Author:
- Abhishek Kumar
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStreammerge(InputStream template, Map<String,Object> values)Method to merge template , where template content will be pass as inputSteambooleanmerge(String templateName, Writer writer, Map<String,Object> values)Merges a template and puts the rendered stream into the writer.booleanmerge(String templateName, Writer writer, Map<String,Object> values, String encodingType)Method to merge template using provided encoding type
-
-
-
Method Detail
-
merge
InputStream merge(InputStream template, Map<String,Object> values) throws IOException
Method to merge template , where template content will be pass as inputSteam- Parameters:
template- theInputStreamis template content .values- as Map<String,Object > where key will be placeholder name and Object is the actual value for the placeholder- Returns:
- template merged template content as
InputStream - Throws:
IOException- if an I/O exception occurs during writing to the writer
-
merge
boolean merge(String templateName, Writer writer, Map<String,Object> values) throws IOException
Merges a template and puts the rendered stream into the writer. The default encoding that template manager uses to read template files is UTF-8- Parameters:
templateName- name of template to be used in mergewriter- output writer for rendered templatevalues- as Map<String,Object > where key is placeholder name and Object is Placeholder value- Returns:
- boolean true if successfully, false otherwise.
- Throws:
IOException- if an I/O exception occurs during writing to the writer
-
merge
boolean merge(String templateName, Writer writer, Map<String,Object> values, String encodingType) throws IOException
Method to merge template using provided encoding type- Parameters:
templateName- name of the template to be used in mergewriter- output writer for render templatevalues- as Map<String,Object > where key is placeholder name and Object is value for the placeholderencodingType- as String like UTF-8,UTF-16 etc.- Returns:
- boolean true if successfully, false otherwise
- Throws:
IOException- if an I/O exception occurs during writing to the writer
-
-