|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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.
| 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 |
|---|
TemplateWriter getTemplateWriter(java.io.PrintWriter writer)
void close()
int getLength()
java.lang.String getElementAt(int position)
void templateWriterFinished(TemplateWriter tw)
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||