|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.util.html.HtmlTemplate
public class HtmlTemplate
This class represents an HTML template that may include bookmarks that can be substitute by values.
Constructor Summary | |
---|---|
HtmlTemplate()
Constructor 1 |
|
HtmlTemplate(HtmlTemplate template)
Constructor 3 |
|
HtmlTemplate(java.lang.String strTemplate)
Constructor 2 |
Method Summary | |
---|---|
java.lang.String |
getHtml()
Returns the template. |
void |
load(java.io.InputStream is)
Load the template from an InputStream |
void |
load(java.lang.String strFilename)
Load the template from a file |
void |
substitute(java.lang.String strBookmark,
java.sql.Date date)
Substitute each appearance of a bookmark by a given value. |
void |
substitute(java.lang.String strBookmark,
int nValue)
Substitute each appearance of a bookmark by a given value. |
void |
substitute(java.lang.String strBookmark,
java.lang.String strValue)
Substitute each appearance of a bookmark by a given value. |
void |
substitute(java.lang.String strBookmark,
java.sql.Timestamp date)
Substitute each occurence of a bookmark by a given value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlTemplate()
public HtmlTemplate(java.lang.String strTemplate)
strTemplate
- The template as a stringpublic HtmlTemplate(HtmlTemplate template)
template
- Copy constructor based on another template.Method Detail |
---|
public void load(java.lang.String strFilename) throws java.io.IOException
strFilename
- The file name to load
java.io.IOException
- If an error occuredpublic void load(java.io.InputStream is) throws java.io.IOException
is
- The open InputStream that point on the template
java.io.IOException
- If an error occuredpublic java.lang.String getHtml()
public void substitute(java.lang.String strBookmark, java.lang.String strValue)
strBookmark
- The bookmark that must be present in the template.strValue
- The value to substitute as a String.public void substitute(java.lang.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(java.lang.String strBookmark, java.sql.Date date)
strBookmark
- The bookmark that must be present in the template.date
- The value to substitute as a Date.public void substitute(java.lang.String strBookmark, java.sql.Timestamp date)
strBookmark
- The bookmark that must be present in the template.date
- The value to substitute as a Timestamp.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |