com.fdsapi
Class Template

java.lang.Object
  |
  +--com.fdsapi.Template
All Implemented Interfaces:
java.lang.Cloneable

public class Template
extends java.lang.Object
implements java.lang.Cloneable

Object that represents a file/String template in memory. Template files are parsed once into a Template object and the program uses this format from that point on.

View Code


Constructor Summary
Template()
           
 
Method Summary
 java.lang.Object clone()
           
 Template copy()
          Same action as clone however clone returns an Object that must be cast and copy casts to a Template.
 java.lang.Object execute(java.lang.Object headerData, java.lang.Object bodyData)
          Performs action to be Taken against the TabularData
 java.lang.Object execute(java.lang.Object headerData, java.lang.Object bodyData, java.util.Map miscDataMap)
          Performs action to be Taken against the TabularData and pass in a map of extra info accessed by the Template (##variables)
 java.lang.String getContents()
          get The contents of the Template String
 void initialize(java.lang.String templateContents)
          Method that allows you to programmatically alter the Template object by passing a String representation of a Template to this method.
 void initialize(java.lang.String templateTag, int row, int col, java.lang.String value)
          Method that allows you to programmatically alter the Template object (similar to parsing a Template)
static void main(java.lang.String[] args)
          This method has sample code that is used to test the DataSetFactory as well as many of the classes used in implementing DataSets such as the DataSetMap and TemplateReader classes
 void setBufferSize(int size)
          Set the buffer size for this template.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Template

public Template()
Method Detail

execute

public java.lang.Object execute(java.lang.Object headerData,
                                java.lang.Object bodyData)
Performs action to be Taken against the TabularData


execute

public java.lang.Object execute(java.lang.Object headerData,
                                java.lang.Object bodyData,
                                java.util.Map miscDataMap)
Performs action to be Taken against the TabularData and pass in a map of extra info accessed by the Template (##variables)


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
java.lang.CloneNotSupportedException

copy

public Template copy()
Same action as clone however clone returns an Object that must be cast and copy casts to a Template. Copy is the preferred method.


initialize

public void initialize(java.lang.String templateTag,
                       int row,
                       int col,
                       java.lang.String value)

Method that allows you to programmatically alter the Template object (similar to parsing a Template)

Sample call:
 
     Template template=new Template();
     template.intialize("body_cell_data", 0, 4, "##this, ##this");
 


initialize

public void initialize(java.lang.String templateContents)

Method that allows you to programmatically alter the Template object by passing a String representation of a Template to this method. This method is called when Template files are parsed.

Sample call:
 
     Template template=new Template();
     template.intialize("##this");
 


getContents

public java.lang.String getContents()
get The contents of the Template String


setBufferSize

public void setBufferSize(int size)
Set the buffer size for this template. This MAY help performance and memory consumption if you know the typical size of the text being generated. Don't assume it will. I have changed it before with no measurable effect on performance.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
This method has sample code that is used to test the DataSetFactory as well as many of the classes used in implementing DataSets such as the DataSetMap and TemplateReader classes

java.lang.Exception