NVelocity.NAnt.Texen
Class TexenTask

An ant task for generating output by using Velocity

Field Summary
Commons.Collections.ExtendedProperties contextProperties
string controlTemplate
         This is the control template that governs the output. It may or may not invoke the services of worker templates.
string inputEncoding
         This is the encoding for the input file(s) (templates).
string outputDirectory
         This is where texen will place all the output that is a product of the generation process.
string outputEncoding
         This is the encoding for the output file(s).
string outputFile
         This is the file where the generated text will be placed.
string templatePath
         This is where Velocity will look for templates using the file template loader.
bool useClasspath
         Property which controls whether the classpath will be used when trying to locate templates.

Fields inherited from class SourceForge.NAnt.Element
_location, _parent, _project, _xmlNode

Constructor Summary
TexenTask()
        Initializes a new instance of the TexenTask class.

Property Summary
string ContextProperties
string ControlTemplate
         [REQUIRED] Set the control template for the generating process.
string InputEncoding
string OutputDirectory
string OutputEncoding
string OutputFile
string TemplatePath

Properties inherited from class SourceForge.NAnt.Task
FailOnError, IfDefined, LogPrefix, Name, UnlessDefined, Verbose

Properties inherited from class SourceForge.NAnt.Element
Location, Parent, Project, Properties

Method Summary
void cleanup()
         A hook method called at the end of {@link #execute()} which can be overridden to perform any necessary cleanup activities (such as the release of database connections, etc.). By default, does nothing.
void ExecuteTask()
         Execute the input script with Velocity @throws BuildException BuildExceptions are thrown when required attributes are missing. Exceptions thrown by Velocity are rethrown as BuildExceptions.
NVelocity.Context.IContext initControlContext()
         Creates a VelocityContext. *
void populateInitialContext(NVelocity.Context.IContext context)
        Place useful objects into the initial context.TexenTask places
Date().toString()
into the context as
$now
. Subclasses who want to vary the objects in the context should override this method.
$generator
is not put into the context in this method.

Methods inherited from class SourceForge.NAnt.Task
Execute, InitializeElement, InitializeTask

Methods inherited from class SourceForge.NAnt.Element
Initialize

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

contextProperties

protected internal Commons.Collections.ExtendedProperties contextProperties


controlTemplate

protected internal string controlTemplate

This is the control template that governs the output. It may or may not invoke the services of worker templates.


inputEncoding

protected internal string inputEncoding

This is the encoding for the input file(s) (templates).


outputDirectory

protected internal string outputDirectory

This is where texen will place all the output that is a product of the generation process.


outputEncoding

protected internal string outputEncoding

This is the encoding for the output file(s).


outputFile

protected internal string outputFile

This is the file where the generated text will be placed.


templatePath

protected internal string templatePath

This is where Velocity will look for templates using the file template loader.


useClasspath

protected internal bool useClasspath

Property which controls whether the classpath will be used when trying to locate templates.

Constructor Detail

TexenTask

public TexenTask()

Initializes a new instance of the TexenTask class.

Property Detail

ContextProperties

public string ContextProperties


ControlTemplate

public string ControlTemplate

[REQUIRED] Set the control template for the generating process.


InputEncoding

public string InputEncoding


OutputDirectory

public string OutputDirectory


OutputEncoding

public string OutputEncoding


OutputFile

public string OutputFile


TemplatePath

public string TemplatePath

Method Detail

cleanup

protected internal void cleanup()

A hook method called at the end of {@link #execute()} which can be overridden to perform any necessary cleanup activities (such as the release of database connections, etc.). By default, does nothing.

Throws:
- Exception Problem cleaning up.

ExecuteTask

protected void ExecuteTask()

Execute the input script with Velocity @throws BuildException BuildExceptions are thrown when required attributes are missing. Exceptions thrown by Velocity are rethrown as BuildExceptions.


initControlContext

public NVelocity.Context.IContext initControlContext()

Creates a VelocityContext. *

Returns:
new Context @throws Exception the execute method will catch and rethrow as a
BuildException

populateInitialContext

protected internal void populateInitialContext(NVelocity.Context.IContext context)

Place useful objects into the initial context.TexenTask places

Date().toString()
into the context as
$now
. Subclasses who want to vary the objects in the context should override this method.
$generator
is not put into the context in this method.

Parameters:
context - The context to populate, as retrieved from {@link #initControlContext()}. @throws Exception Error while populating context. The {@link #execute()} method will catch and rethrow as a
BuildException
.