org.webmacro.servlet
Class TemplateTool.MacroTemplateFactory

java.lang.Object
  |
  +--org.webmacro.servlet.TemplateTool.MacroTemplateFactory
Enclosing class:
TemplateTool

public class TemplateTool.MacroTemplateFactory
extends java.lang.Object

A factory class for creating MacroTemplate objects.


Constructor Summary
TemplateTool.MacroTemplateFactory(Context ctx)
          Constructor
 
Method Summary
 TemplateTool.MacroTemplate fromFile(java.lang.String fileRef)
          Creates a MacroTemplate from a file reference with a new context.
 TemplateTool.MacroTemplate fromString(java.lang.String s)
          Creates a MacroTemplate from a string with a new context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateTool.MacroTemplateFactory

public TemplateTool.MacroTemplateFactory(Context ctx)
Constructor
Parameters:
ctx - the context for the current request
Method Detail

fromString

public TemplateTool.MacroTemplate fromString(java.lang.String s)
Creates a MacroTemplate from a string with a new context.
Parameters:
s - the template string
Returns:
the new MacroTemplate

fromFile

public TemplateTool.MacroTemplate fromFile(java.lang.String fileRef)
                                    throws ResourceException
Creates a MacroTemplate from a file reference with a new context.
Parameters:
fileRef - a reference to the template file
Returns:
a new MacroTemplate
Throws:
ResourceException - if the file cannot be found or parsed