public class Template
extends java.lang.Object
| Constructor and Description |
|---|
Template(java.io.File templateFile)
Obtains an instance of Template from the template file
|
Template(java.io.InputStream templateIs)
Obtains an instance of Template from the template input stream
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.String key,
java.lang.String value) |
java.nio.charset.Charset |
getCharset() |
char |
getDelimiter() |
void |
replace()
Replace all the key tags with the related values
|
void |
setCharset(java.nio.charset.Charset charset) |
void |
setDelimiter(char delimiter) |
void |
write(java.io.File outFile) |
public Template(java.io.File templateFile)
throws java.io.IOException
templateFile - - the template filejava.io.IOExceptionpublic Template(java.io.InputStream templateIs)
throws java.io.IOException
templateIs - - the template input streamjava.io.IOExceptionpublic void setDelimiter(char delimiter)
delimiter - - the delimiter char used for search tags (default is #)public char getDelimiter()
public java.nio.charset.Charset getCharset()
public void setCharset(java.nio.charset.Charset charset)
charset - - the charset to use (default is UTF-8)public void add(java.lang.String key,
java.lang.String value)
key - - the key of the tagvalue - - the value to replace for the tagpublic void replace()
throws java.io.IOException
java.io.IOExceptionpublic void write(java.io.File outFile)
throws java.io.IOException
outFile - java.io.IOException