org.webmacro.tools
Class EvalTemplates

java.lang.Object
  extended byorg.webmacro.tools.EvalTemplates

public class EvalTemplates
extends java.lang.Object

EvalTemplates supports an ant task execution to evaluate a set of templates.

This class has been structured to make use of WMEval which maintains an instance of WM and has support methods for evaluating templates and routing output.

This is a batch oriented class which is referenced normally as part of an ant build script. See the WebMacro build script for actual usage.

Author:
Lane Sharman
See Also:
TemplateEvalAntTask

Constructor Summary
EvalTemplates()
           
 
Method Summary
 java.lang.Object getContextElement(java.lang.String key)
          After a template has been run, this method will return an object in the context by name.
static void main(java.lang.String[] args)
          Normally this main is invoked from an ant task but it can be invoked from any main launcher including a command line.
 void run(java.lang.String inputTemplate)
          Evaluates a single template file argument.
 Context run(java.lang.String inputTemplate, java.lang.String outFile, boolean append, java.lang.String encoding)
          Evaluates a single template file argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvalTemplates

public EvalTemplates()
Method Detail

run

public void run(java.lang.String inputTemplate)
Evaluates a single template file argument. Exceptions are reported to standard error, not thrown.


run

public Context run(java.lang.String inputTemplate,
                   java.lang.String outFile,
                   boolean append,
                   java.lang.String encoding)
Evaluates a single template file argument. Exceptions are reported to standard error, not thrown.

This method provides programmer control over the evaluation options.

Parameters:
inputTemplate - A template in the resource path.
outFile - An output file for the template output. If null, the template must set the output.
append - If true, output will be appended to existing file.
encoding - The encoding to use on the output file, null allowed.

getContextElement

public java.lang.Object getContextElement(java.lang.String key)
After a template has been run, this method will return an object in the context by name.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Normally this main is invoked from an ant task but it can be invoked from any main launcher including a command line.

Parameters:
args - One or more file references to an input template file name.
Throws:
java.lang.Exception


Copyright © 1999-2006 WebMacro. All Rights Reserved.