fccsc.manager.util
Class TemplateManager

java.lang.Object
  |
  +--fccsc.manager.util.TemplateManager

public final class TemplateManager
extends java.lang.Object


Constructor Summary
TemplateManager()
           
 
Method Summary
static java.lang.String display()
          Display a listing of all loaded template files.
static void init(java.lang.String p_directoryPath)
          Initializes this manager with the location (directory path) of template files to load.
static void load(java.lang.String p_fileName)
          Loads a (*.template) file from our root directory path provided in the constructor of this object.
static void loadAll()
          Loads all the (*.template) files from our root directory path provided in the constructor of this object.
static java.lang.String populate(java.lang.String p_templateName, java.lang.String p_data)
          Parses and loads the specified template with the given data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateManager

public TemplateManager()
Method Detail

init

public static void init(java.lang.String p_directoryPath)
Initializes this manager with the location (directory path) of template files to load.

Parameters:
p_directoryPath - the absolute directory path, i.e... D:\\manager\\templates

display

public static java.lang.String display()
Display a listing of all loaded template files.

Returns:
a string representation of internal data.

loadAll

public static void loadAll()
Loads all the (*.template) files from our root directory path provided in the constructor of this object. This method filters out all *.template files and loads each file into an internal hashtable data structure and maps the loaded Template file with its file * name (.template).


load

public static void load(java.lang.String p_fileName)
Loads a (*.template) file from our root directory path provided in the constructor of this object. This method loads the file into an internal hashtable data structure and maps the loaded Template file with its file name (.template).

Parameters:
p_fileName - the template file to load.

populate

public static java.lang.String populate(java.lang.String p_templateName,
                                        java.lang.String p_data)
Parses and loads the specified template with the given data.

Parameters:
p_templateName - the template to parse and load.
p_data - the data to insert into the template.
Returns:
a string of the template after data insertion.