fr.paris.lutece.util.html
Class HtmlTemplate

java.lang.Object
  extended by fr.paris.lutece.util.html.HtmlTemplate

public class HtmlTemplate
extends java.lang.Object

This class represents an HTML template that may include bookmarks that can be substitute by values.

Version:
1.2.5

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

HtmlTemplate

public HtmlTemplate()
Constructor 1


HtmlTemplate

public HtmlTemplate(java.lang.String strTemplate)
Constructor 2

Parameters:
strTemplate - The template as a string

HtmlTemplate

public HtmlTemplate(HtmlTemplate template)
Constructor 3

Parameters:
template - Copy constructor based on another template.
Method Detail

load

public void load(java.lang.String strFilename)
          throws java.io.IOException
Load the template from a file

Parameters:
strFilename - The file name to load
Throws:
java.io.IOException

load

public void load(java.io.InputStream is)
          throws java.io.IOException
Load the template from an InputStream

Parameters:
is - The open InputStream that point on the template
Throws:
java.io.IOException

getHtml

public java.lang.String getHtml()
Returns the template.

Returns:
The template as a string.

substitute

public void substitute(java.lang.String strBookmark,
                       java.lang.String strValue)
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

public void substitute(java.lang.String strBookmark,
                       int nValue)
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

public void substitute(java.lang.String strBookmark,
                       java.sql.Date date)
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

public void substitute(java.lang.String strBookmark,
                       java.sql.Timestamp date)
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.


Copyright © 2007 Mairie de Paris. All Rights Reserved.