public class HtmlTemplate extends Object
Constructor and Description |
---|
HtmlTemplate()
Constructor 1
|
HtmlTemplate(HtmlTemplate template)
Constructor 3
|
HtmlTemplate(String strTemplate)
Constructor 2
|
Modifier and Type | Method and Description |
---|---|
String |
getHtml()
Returns the template.
|
void |
load(InputStream is)
Load the template from an InputStream
|
void |
load(String strFilename)
Load the template from a file
|
void |
substitute(String strBookmark,
Date date)
Substitute each appearance of a bookmark by a given value.
|
void |
substitute(String strBookmark,
int nValue)
Substitute each appearance of a bookmark by a given value.
|
void |
substitute(String strBookmark,
String strValue)
Substitute each appearance of a bookmark by a given value.
|
void |
substitute(String strBookmark,
Timestamp date)
Substitute each occurence of a bookmark by a given value.
|
public HtmlTemplate()
public HtmlTemplate(String strTemplate)
strTemplate
- The template as a stringpublic HtmlTemplate(HtmlTemplate template)
template
- Copy constructor based on another template.public void load(String strFilename) throws IOException
strFilename
- The file name to loadIOException
- If an error occuredpublic void load(InputStream is) throws IOException
is
- The open InputStream that point on the templateIOException
- If an error occuredpublic String getHtml()
public void substitute(String strBookmark, String strValue)
strBookmark
- The bookmark that must be present in the template.strValue
- The value to substitute as a String.public void substitute(String strBookmark, int nValue)
strBookmark
- The bookmark that must be present in the template.nValue
- The value to substitute as an integer.public void substitute(String strBookmark, Date date)
strBookmark
- The bookmark that must be present in the template.date
- The value to substitute as a Date.Copyright © 2020 City of Paris. All rights reserved.