com.fdsapi
Class Templates

java.lang.Object
  |
  +--com.fdsapi.Templates

public class Templates
extends java.lang.Object

Object that contains individual Template objects.

View Code


Constructor Summary
Templates()
          Populates html table, listbox, drop down list box and radio button default templates.
 
Method Summary
 Template get(java.lang.String templateLogicalName)
          Returns an existing Template or null if the template doesn't exist.
 void initialize(java.lang.String[][] templateFiles)
          Loop through each template file, read the template file, parse it and populate the Templates object with the parsed templates.
static void main(java.lang.String[] args)
          Test and sample usage for the Templates class
 void put(java.lang.String templateLogicalName, Template template)
          Adds a new Template or if the template already exists it appends/overwrites any existing template tag variables.
 void remove(java.lang.String templateLogicalName)
          Removes an existing Template or performs no action if the template doesn't exist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Templates

public Templates()
Populates html table, listbox, drop down list box and radio button default templates. These may be overwritten by developers if they desire.

Method Detail

put

public void put(java.lang.String templateLogicalName,
                Template template)
Adds a new Template or if the template already exists it appends/overwrites any existing template tag variables. The internals of this method are synchronized.


get

public Template get(java.lang.String templateLogicalName)
Returns an existing Template or null if the template doesn't exist. The internals of this method are synchronized.


remove

public void remove(java.lang.String templateLogicalName)
Removes an existing Template or performs no action if the template doesn't exist. The internals of this method are synchronized.


initialize

public void initialize(java.lang.String[][] templateFiles)

Loop through each template file, read the template file, parse it and populate the Templates object with the parsed templates. The format of the array is:

logicalTemplateName, fully qualified template file location

For example

table, \my dir\my subdir\table1.html
table, \my dir\table2.html
salaries, \my dir\salaries.html

Any conflicting entries in the table1.html will be overwritten by table2.html.

If the template name already exists it will be inherited from not created from scratch.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test and sample usage for the Templates class

java.lang.Exception