Framework Professional Edition Package


com.prosyst.util.template
Interface HTMLTemplate

All Known Implementing Classes:
HTMLTemplateFileImpl

public interface HTMLTemplate

A class, representing a layer of abstraction for a HTML Template file The HTML template file is a text file containing HTML text with labels in the place(s) where runtime info will be inserted. A label has the following format - $LABEL_NAME$. The LABEL_NAME can be any String. Two labels can have the same name. This class is used in the following way: First, an HTMLTemplate object is created from the template file. This object contains the parsed image of the template. Then every time the page is to be sent to a user, a new TemplateWriter object is got from the HTMLTemplate object with the writer from the current response. The writeToNextLabel() method of this TemplateWriter is called repeatedly to write all the staic HTML content, while between the calls the servlet generates only the corresponding runtime info.

Author:
Sofia Doncheva

Method Summary
 void close()
          Cleans up any internal data, connections, etc.
 java.lang.String getElementAt(int position)
          Returns the element in the given position in the template.
 int getLength()
          Returns the number of pieces the template was separated into (the number of constant HTML pieces + the number of labels)
 TemplateWriter getTemplateWriter(java.io.PrintWriter writer)
          Creates a new TemplateWriter with initialized writer and internal pointer.
 void templateWriterFinished(TemplateWriter tw)
          Called to notify the template that the work with one of the writers was finished.
 

Method Detail

getTemplateWriter

TemplateWriter getTemplateWriter(java.io.PrintWriter writer)
Creates a new TemplateWriter with initialized writer and internal pointer.

Returns:
The created TemplateWriter.

close

void close()
Cleans up any internal data, connections, etc.


getLength

int getLength()
Returns the number of pieces the template was separated into (the number of constant HTML pieces + the number of labels)

Returns:
the number of elements in the template.

getElementAt

java.lang.String getElementAt(int position)
Returns the element in the given position in the template. (This can be either a piece of constant HTML code or a label).

Returns:
The element at the given position.

templateWriterFinished

void templateWriterFinished(TemplateWriter tw)
Called to notify the template that the work with one of the writers was finished.


Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved