public class Template
extends java.lang.Object
| Constructor and Description |
|---|
Template(java.util.ArrayList<java.lang.String> script)
Creates an instance and concatenates the script from the input lines
|
Template(java.lang.String file)
Creates an instance and loads the specified file from the classpath as template.
|
| Modifier and Type | Method and Description |
|---|---|
Template |
setPlaceholder(java.lang.String placeholder,
java.lang.String content)
Replaces occurences of the placeholder {{NAME}} to the specified content.
|
java.lang.String |
toString() |
void |
writeTo(java.io.File file)
Writes the template with replaced placeholder to the specified file.
|
public Template(java.lang.String file)
throws java.io.IOException
file - the file in classpath relative to the package of this classjava.io.IOException - on errors during reading the filepublic Template(java.util.ArrayList<java.lang.String> script)
script - input linespublic Template setPlaceholder(java.lang.String placeholder, java.lang.String content)
placeholder - the name of the placerholdercontent - the content to which to placeholder will be replacespublic void writeTo(java.io.File file)
throws java.io.IOException
file - the file to write tojava.io.IOException - on errors during writingpublic java.lang.String toString()
toString in class java.lang.Object