Package fr.paris.lutece.util.html
Class HtmlTemplate
java.lang.Object
fr.paris.lutece.util.html.HtmlTemplate
This class represents an HTML template that may include bookmarks that can be
substitute by values.
- Version:
- 1.2.5
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor 1HtmlTemplate(HtmlTemplate template) Constructor 3HtmlTemplate(String strTemplate) Constructor 2 -
Method Summary
Modifier and TypeMethodDescriptiongetHtml()Returns the template.voidload(InputStream is) Load the template from an InputStreamvoidLoad the template from a filevoidsubstitute(String strBookmark, int nValue) Substitute each appearance of a bookmark by a given value.voidsubstitute(String strBookmark, String strValue) Substitute each appearance of a bookmark by a given value.voidsubstitute(String strBookmark, Date date) Substitute each appearance of a bookmark by a given value.voidsubstitute(String strBookmark, Timestamp date) Substitute each occurence of a bookmark by a given value.
-
Constructor Details
-
HtmlTemplate
public HtmlTemplate()Constructor 1 -
HtmlTemplate
Constructor 2- Parameters:
strTemplate- The template as a string
-
HtmlTemplate
Constructor 3- Parameters:
template- Copy constructor based on another template.
-
-
Method Details
-
load
Load the template from a file- Parameters:
strFilename- The file name to load- Throws:
IOException- If an error occured
-
load
Load the template from an InputStream- Parameters:
is- The open InputStream that point on the template- Throws:
IOException- If an error occured
-
getHtml
Returns the template.- Returns:
- The template as a string.
-
substitute
Substitute each appearance of a bookmark by a given value.- Parameters:
strBookmark- The bookmark that must be present in the template.strValue- The value to substitute as a String.
-
substitute
Substitute each appearance of a bookmark by a given value.- Parameters:
strBookmark- The bookmark that must be present in the template.nValue- The value to substitute as an integer.
-
substitute
Substitute each appearance of a bookmark by a given value.- Parameters:
strBookmark- The bookmark that must be present in the template.date- The value to substitute as a Date.
-
substitute
Substitute each occurence of a bookmark by a given value.- Parameters:
strBookmark- The bookmark that must be present in the template.date- The value to substitute as a Timestamp.
-