All Packages Class
Hierarchy This Package Previous Next Index
Class com.abc.templates.TemplateLoader
java.lang.Object
|
+----com.abc.templates.TemplateLoader
- public class TemplateLoader
- extends Object
- TemplateLoader is an object responsible for loading, compiling of templates.Usually this
class exist only in one instance per application/servlet.
TemplateLoader()
- Constructor.
compileAll( String sTemplExt, String sComplExt)
- sTemplExt - is an extension for original files.
- sComplExt is an extension for compiled files.
- This method gives us ability to mix plain html file with templates and not to lose
benefits of global substituion.
- Example: TemplateLoader.compileAll("thtm", "html");
- That method will generate html files from thml files and substitute all global tags
defined in configurational file.
getSubstitute(String)
- retrives value for globall substitutor.
getSubstitutor()
- retrive global Substitutor.
getTemplate(String sName)
- retrives Template object coresponded to template file sName. Please note: template file
must have extension .txt and sName should not have extension.
- Example: TemplateLoader.getTemplate("template"); //
TemplateLoader.getTemplate("template.txt")
setPath(String sPath,
String sConfigFile)
- sets folder where all templates are located and configurational file in that folde. If
you do not need configurational file then pass null.
- example: setPath("c:\\", null); Please note '\'
symbol at the end of path.
-

TemplateLoader
public TemplateLoader()

compileAll
public void compileAll( String sTemplExt,String SComplExt)

getSubstitute
public final String getSubstitute(String sName)

getSubstitutor
public final Substitutor
getSubstitutor()

getTemplate
public Template getTemplate(String
sName) throws IOException, ClassNotFoundException

setPath
public void setPath(String sTemplatePath,
String sConfigFile) throws IOException
All Packages Class Hierarchy This Package Previous Next Index