public class TemplateHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
KEY_TEMPLATE
The keys template
|
| Modifier | Constructor and Description |
|---|---|
private |
TemplateHelper()
This private constructor is defined according to this class responsibility to provide helper
static methods to fill templates with values.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
fill(java.io.InputStream template,
java.util.Map<java.lang.String,java.util.function.Supplier<java.lang.String>> keysProvider,
java.io.PrintWriter writer,
java.lang.String charset)
Process template and make any replacements of parameter values as needed.
|
private TemplateHelper()
public static void fill(java.io.InputStream template,
java.util.Map<java.lang.String,java.util.function.Supplier<java.lang.String>> keysProvider,
java.io.PrintWriter writer,
java.lang.String charset)
throws java.io.IOException
Example: ${expression}
template - The template as an input stream.keysProvider - The keys provider to fill gaps with values.writer - The print writer to output the target document with help of the given template.charset - The charset used to read the given templatejava.io.IOException